diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 10b09d62ad..39fe08c8b4 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -882,6 +882,19 @@ function wp_audio_shortcode( $attr ) { static $instances = 0; $instances++; + /** + * Override the default audio shortcode. + * + * @since 3.7.0 + * + * @param null Empty variable to be replaced with shortcode markup. + * @param array $attr Attributes of the shortcode. + * @param int $instances Unique numeric ID of this audio shortcode instance. + */ + $html = apply_filters( 'wp_audio_shortcode_override', null, $attr, $instances ); + if ( null !== $html ) + return $html; + $audio = null; $default_types = wp_get_audio_extensions(); @@ -975,7 +988,7 @@ function wp_audio_shortcode( $attr ) { return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library ); } -add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) ); +add_shortcode( 'audio', 'wp_audio_shortcode' ); /** * Return a filtered list of WP-supported video formats @@ -1005,6 +1018,19 @@ function wp_video_shortcode( $attr ) { static $instances = 0; $instances++; + /** + * Override the default video shortcode. + * + * @since 3.7.0 + * + * @param null Empty variable to be replaced with shortcode markup. + * @param array $attr Attributes of the shortcode. + * @param int $instances Unique numeric ID of this video shortcode instance. + */ + $html = apply_filters( 'wp_video_shortcode_override', null, $attr, $instances ); + if ( null !== $html ) + return $html; + $video = null; $default_types = wp_get_video_extensions(); @@ -1119,7 +1145,7 @@ function wp_video_shortcode( $attr ) { $html = sprintf( '