Classic_Editor::render_setup_options( null|WP_Post|int $post = null, bool $echo = true )

Renders, echoing to the page, the YouTube Integration fields.


Parameters

$post

(null|WP_Post|int) (Optional) The post object or ID of the event to generate the controls for, or null to use the global post object.

Default value: null

$echo

(bool) (Optional) Whether to echo the template contents to the page (default) or to return it.

Default value: true


Top ↑

Return

(string) The template contents, if not rendered to the page.


Top ↑

Source

File: src/Tribe/Meetings/YouTube/Classic_Editor.php

	public function render_setup_options( $post = null, $echo = true ) {
		$post = tribe_get_event( get_post( $post ) );

		if ( ! $post instanceof \WP_Post ) {
			return '';
		}

		// Make sure to apply the YouTube properties to the event.
		YouTube_Meta::add_event_properties( $post );

		// Get the current YouTube Fields, it will return an array of saved values or the defaults.
		$fields = YouTube_Meta::get_current_fields( $post );

		return $this->template->template(
			'virtual-metabox/youtube/controls',
			[
				'event'  => $post,
				'fields' => $fields,
			],
			$echo
		);
	}

Top ↑

Changelog

Changelog
Version Description
1.6.0 Introduced.