wp_video_shortcode
Filters the output of the video shortcode.
Usage
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(string)
- Video shortcode HTML output.
- $atts(array)
- Array of video shortcode attributes.
- $video(string)
- Video file.
- $post_id(int)
- Post ID.
- $library(string)
- Media library used for the video shortcode.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
wp-includes/media.php 3814
return apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );
Where the hook is used in 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' ) );