Tribe__JSON_LD__Abstract::get( int|WP_Post $post = null )

Gets from the Posts index a specific post or fetch all of them


Parameters

$post

(int|WP_Post) (Optional) The Post Object or ID

Default value: null


Top ↑

Return

(null|array|WP_Post) Returns an Indexed Array of Posts, a found Post or Null if not found


Top ↑

Source

File: src/Tribe/JSON_LD/Abstract.php

	public function get( $post = null ) {
		if ( is_null( $post ) ) {
			return self::$posts;
		}
		$id = Tribe__Main::post_id_helper( $post );

		if ( $this->exists( $id ) ) {
			return self::$posts[ $id ];
		}

		return null;
	}