Tribe__Events__Validator__Base::is_event_id( int|string $event_id )
Whether the value is the post ID of an existing event or not.
Contents
Parameters
- $event_id
-
(int|string) (Required)
Return
(bool)
Source
File: src/Tribe/Validator/Base.php
public function is_event_id( $event_id ) {
if ( empty( $event_id ) ) {
return false;
}
$event = get_post( $event_id );
return ! empty( $event ) && Tribe__Events__Main::POSTTYPE === $event->post_type;
}
Changelog
| Version | Description |
|---|---|
| 4.6 | Introduced. |