Tribe__Events__JSON_LD__Organizer::get_data( int|WP_Post|null $post = null, array $args = array('context' => false) )

Fetches the JSON-LD data for this type of object


Parameters

$post

(int|WP_Post|null) (Optional) The post/organizer

Default value: null

$args

(array) (Optional)

Default value: array('context' => false)


Top ↑

Return

(array)


Top ↑

Source

File: src/Tribe/JSON_LD/Organizer.php

	public function get_data( $post = null, $args = array( 'context' => false ) ) {
		$data = parent::get_data( $post, $args );

		// If we have an Empty data we just skip
		if ( empty( $data ) ) {
			return array();
		}

		// Fetch first key
		$post_id = key( $data );

		// Fetch first Value
		$data = reset( $data );

		$data->telephone = tribe_get_organizer_phone( $post_id );
		$data->email = tribe_get_organizer_email( $post_id );
		$data->sameAs = tribe_get_organizer_website_url( $post_id );

		$data = $this->apply_object_data_filter( $data, $args, $post );
		return array( $post_id => $data );
	}