Make WordPress Core

Ticket #25313: 25313.4.patch

File 25313.4.patch, 1.5 KB (added by ericlewis, 13 years ago)
  • wp-includes/media.php

     
    853853        static $instances = 0;
    854854        $instances++;
    855855
     856        // Allow plugins and themes to short-circuit the shortcode.
     857        $html = apply_filters( 'wp_audio_shortcode_override', false, $attr, $instances );
     858        if ( false !== $html )
     859                return $html;
     860
    856861        $audio = null;
    857862
    858863        $default_types = wp_get_audio_extensions();
    … …  
    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
    … …  
    976981        static $instances = 0;
    977982        $instances++;
    978983
     984        // Allow plugins and themes to short-circuit the shortcode.
     985        $html = apply_filters( 'wp_video_shortcode_override', false, $attr, $instances );
     986        if ( false !== $html )
     987                return $html;
     988
    979989        $video = null;
    980990
    981991        $default_types = wp_get_video_extensions();
    … …  
    10901100        $html = sprintf( '<div style="width: %dpx; max-width: 100%%;">%s</div>', $width, $html );
    10911101        return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
    10921102}
    1093 add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
     1103add_shortcode( 'video', 'wp_video_shortcode' );
    10941104
    10951105/**
    10961106 * Display previous image link that has the same post parent.