wp_video_shortcode_override
Filters the default video shortcode output.
If the filtered output isn't empty, it will be used instead of generating the default video template.
Usage
add_filter( 'wp_video_shortcode_override', 'wp_kama_video_shortcode_override_filter', 10, 4 ); /** * Function for `wp_video_shortcode_override` filter-hook. * * @param string $html Empty variable to be replaced with shortcode markup. * @param array $attr Attributes of the shortcode. See {@see wp_video_shortcode()}. * @param string $content Video shortcode content. * @param int $instance Unique numeric ID of this video shortcode instance. * * @return string */ function wp_kama_video_shortcode_override_filter( $html, $attr, $content, $instance ){ // filter... return $html; }
- $html(string)
- Empty variable to be replaced with shortcode markup.
- $attr(array)
- Attributes of the shortcode. See {@see wp_video_shortcode()}.
- $content(string)
- Video shortcode content.
- $instance(int)
- Unique numeric ID of this video shortcode instance.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
wp-includes/media.php 3481
$override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance );