Classic_Editor::render_setup_options( null|WP_Post|int $post = null, bool $echo = true )
Renders, echoing to the page, the YouTube Integration fields.
Contents
Parameters
- $post
-
(null|WP_Post|int) (Optional) The post object or ID of the event to generate the controls for, or
nullto 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
Return
(string) The template contents, if not rendered to the page.
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
);
}
Changelog
| Version | Description |
|---|---|
| 1.6.0 | Introduced. |