Make WordPress Core

Ticket #25313: 25313.3.patch

File 25313.3.patch, 1.6 KB (added by SergeyBiryukov, 13 years ago)
  • src/wp-includes/media.php

     
    848848 * @return string HTML content to display audio.
    849849 */
    850850function wp_audio_shortcode( $attr ) {
     851        // Allow plugins to short-circuit the shortcode.
     852        $html = apply_filters( 'wp_audio_shortcode_handler', false, $attr );
     853        if ( false !== $html )
     854                return $html;
     855
    851856        $post_id = get_post() ? get_the_ID() : 0;
    852857
    853858        static $instances = 0;
    … …  
    946951
    947952        return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
    948953}
    949 add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) );
     954add_shortcode( 'audio', 'wp_audio_shortcode' );
    950955
    951956/**
    952957 * Return a filtered list of WP-supported video formats
    … …  
    971976 */
    972977function wp_video_shortcode( $attr ) {
    973978        global $content_width;
     979
     980        // Allow plugins to short-circuit the shortcode.
     981        $html = apply_filters( 'wp_video_shortcode_handler', false, $attr );
     982        if ( false !== $html )
     983                return $html;
     984
    974985        $post_id = get_post() ? get_the_ID() : 0;
    975986
    976987        static $instances = 0;
    … …  
    10901101        $html = sprintf( '<div style="width: %dpx; max-width: 100%%;">%s</div>', $width, $html );
    10911102        return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
    10921103}
    1093 add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
     1104add_shortcode( 'video', 'wp_video_shortcode' );
    10941105
    10951106/**
    10961107 * Display previous image link that has the same post parent.