WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Widget_Media_Video::render_media() public WP 4.8.0

Render the media on the frontend.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$WP_Widget_Media_Video = new WP_Widget_Media_Video();
$WP_Widget_Media_Video->render_media( $instance );
$instance(массив) (обязательный)
Widget instance props.

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

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

Код WP_Widget_Media_Video::render_media() WP 5.5.1

wp-includes/widgets/class-wp-widget-media-video.php
<?php
public function render_media( $instance ) {
	$instance   = array_merge( wp_list_pluck( $this->get_instance_schema(), 'default' ), $instance );
	$attachment = null;

	if ( $this->is_attachment_with_mime_type( $instance['attachment_id'], $this->widget_options['mime_type'] ) ) {
		$attachment = get_post( $instance['attachment_id'] );
	}

	$src = $instance['url'];
	if ( $attachment ) {
		$src = wp_get_attachment_url( $attachment->ID );
	}

	if ( empty( $src ) ) {
		return;
	}

	$youtube_pattern = '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#';
	$vimeo_pattern   = '#^https?://(.+\.)?vimeo\.com/.*#';

	if ( $attachment || preg_match( $youtube_pattern, $src ) || preg_match( $vimeo_pattern, $src ) ) {
		add_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );

		echo wp_video_shortcode(
			array_merge(
				$instance,
				compact( 'src' )
			),
			$instance['content']
		);

		remove_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );
	} else {
		echo $this->inject_video_max_width_style( wp_oembed_get( $src ) );
	}
}