WP_Widget_Media_Video::render_control_template_scripts()publicWP 4.8.0

Render form template scripts.

Метод класса: WP_Widget_Media_Video{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Widget_Media_Video = new WP_Widget_Media_Video();
$WP_Widget_Media_Video->render_control_template_scripts();

Список изменений

С версии 4.8.0 Введена.

Код WP_Widget_Media_Video::render_control_template_scripts() WP 6.5.3

<?php
public function render_control_template_scripts() {
	parent::render_control_template_scripts()
	?>
	<script type="text/html" id="tmpl-wp-media-widget-video-preview">
		<# if ( data.error && 'missing_attachment' === data.error ) { #>
			<?php
			wp_admin_notice(
				$this->l10n['missing_attachment'],
				array(
					'type'               => 'error',
					'additional_classes' => array( 'notice-alt', 'notice-missing-attachment' ),
				)
			);
			?>
		<# } else if ( data.error && 'unsupported_file_type' === data.error ) { #>
			<?php
			wp_admin_notice(
				$this->l10n['unsupported_file_type'],
				array(
					'type'               => 'error',
					'additional_classes' => array( 'notice-alt', 'notice-missing-attachment' ),
				)
			);
			?>
		<# } else if ( data.error ) { #>
			<?php
			wp_admin_notice(
				__( 'Unable to preview media due to an unknown error.' ),
				array(
					'type'               => 'error',
					'additional_classes' => array( 'notice-alt' ),
				)
			);
			?>
		<# } else if ( data.is_oembed && data.model.poster ) { #>
			<a href="{{ data.model.src }}" target="_blank" class="media-widget-video-link">
				<img src="{{ data.model.poster }}" />
			</a>
		<# } else if ( data.is_oembed ) { #>
			<a href="{{ data.model.src }}" target="_blank" class="media-widget-video-link no-poster">
				<span class="dashicons dashicons-format-video"></span>
			</a>
		<# } else if ( data.model.src ) { #>
			<?php wp_underscore_video_template(); ?>
		<# } #>
	</script>
	<?php
}