Tribe__Events__Validator__Base::is_event_id( int|string $event_id )

Whether the value is the post ID of an existing event or not.


Parameters

$event_id

(int|string) (Required)


Top ↑

Return

(bool)


Top ↑

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;
	}

Top ↑

Changelog

Changelog
Version Description
4.6 Introduced.