Tribe__Events__Main::isEvent( $event )

Check whether a post is an event.


Parameters

(int|WP_Post) (Required) The event/post id or object.


Top ↑

Return

(bool) Is it an event?


Top ↑

Source

File: src/Tribe/Main.php

		public function isEvent( $event ) {
			if ( $event === null || ( ! is_numeric( $event ) && ! is_object( $event ) ) ) {
				global $post;
				if ( is_object( $post ) && isset( $post->ID ) ) {
					$event = $post->ID;
				}
			}
			if ( is_numeric( $event ) ) {
				if ( get_post_type( $event ) == self::POSTTYPE ) {
					return true;
				}
			} elseif ( is_object( $event ) ) {
				if ( get_post_type( $event ) == self::POSTTYPE ) {
					return true;
				}
			}

			return false;
		}