Make WordPress Core

Ticket #25313: 25313.6.patch

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

     
    853853        static $instances = 0;
    854854        $instances++;
    855855
     856        /**
     857         * Override the default audio shortcode.
     858         *
     859         * @since 3.7.0
     860         *
     861         * @param null Empty variable to be replaced with shortcode markup.
     862         * @param array $attr Attributes of the shortcode.
     863         * @param int $instances Unique numeric ID of this audio shortcode instance.
     864         */
     865        $html = apply_filters( 'wp_audio_shortcode_override', null, $attr, $instances );
     866        if ( is_string( $html ) )
     867                return $html;
     868
    856869        $audio = null;
    857870
    858871        $default_types = wp_get_audio_extensions();
    … …  
    946959
    947960        return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
    948961}
    949 add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) );
     962add_shortcode( 'audio', 'wp_audio_shortcode' );
    950963
    951964/**
    952965 * Return a filtered list of WP-supported video formats
    … …  
    976989        static $instances = 0;
    977990        $instances++;
    978991
     992        /**
     993         * Override the default video shortcode.
     994         *
     995         * @since 3.7.0
     996         *
     997         * @param null Empty variable to be replaced with shortcode markup.
     998         * @param array $attr Attributes passed from the shortcode.
     999         * @param int $instances Unique numeric ID of this video shortcode instance.
     1000         */
     1001        $html = apply_filters( 'wp_video_shortcode_override', null, $attr, $instances );
     1002        if ( is_string( $html ) )
     1003                return $html;
     1004
    9791005        $video = null;
    9801006
    9811007        $default_types = wp_get_video_extensions();
    … …  
    10901116        $html = sprintf( '<div style="width: %dpx; max-width: 100%%;">%s</div>', $width, $html );
    10911117        return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
    10921118}
    1093 add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
     1119add_shortcode( 'video', 'wp_video_shortcode' );
    10941120
    10951121/**
    10961122 * Display previous image link that has the same post parent.