wp_video_shortcode хук-фильтрWP 3.6.0

Filters the output of the video shortcode.

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

add_filter( 'wp_video_shortcode', 'wp_kama_video_shortcode_filter', 10, 5 );

/**
 * Function for `wp_video_shortcode` filter-hook.
 * 
 * @param string $output  Video shortcode HTML output.
 * @param array  $atts    Array of video shortcode attributes.
 * @param string $video   Video file.
 * @param int    $post_id Post ID.
 * @param string $library Media library used for the video shortcode.
 *
 * @return string
 */
function wp_kama_video_shortcode_filter( $output, $atts, $video, $post_id, $library ){

	// filter...
	return $output;
}
$output(строка)
Video shortcode HTML output.
$atts(массив)
Array of video shortcode attributes.
$video(строка)
Video file.
$post_id(int)
Post ID.
$library(строка)
Media library used for the video shortcode.

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

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

Где вызывается хук

wp_video_shortcode()
wp_video_shortcode
wp-includes/media.php 3691
return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );

Где используется хук в WordPress

wp-includes/widgets/class-wp-widget-media-video.php 133
add_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );
wp-includes/widgets/class-wp-widget-media-video.php 143
remove_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) );