Make WordPress Core

Ticket #24456: 24456.diff

File 24456.diff, 1.6 KB (added by kovshenin, 12 years ago)
  • wp-includes/media.php

     
    841841 * @param array $attr Attributes of the shortcode.
    842842 * @return string HTML content to display audio.
    843843 */
    844 function wp_audio_shortcode( $attr ) {
     844function wp_audio_shortcode( $attr, $content = null ) {
    845845        $post_id = get_post() ? get_the_ID() : 0;
    846846
    847847        static $instances = 0;
     
    854854        foreach ( $default_types as $type  )
    855855                $defaults_atts[$type] = '';
    856856
     857        if ( empty( $attr['src'] ) && ! empty( $content ) )
     858                $attr['src'] = $content;
     859
    857860        $atts = shortcode_atts( $defaults_atts, $attr, 'audio' );
    858861        extract( $atts );
    859862
     
    940943 * @param array $attr Attributes of the shortcode.
    941944 * @return string HTML content to display video.
    942945 */
    943 function wp_video_shortcode( $attr ) {
     946function wp_video_shortcode( $attr, $content = null ) {
    944947        global $content_width;
    945948        $post_id = get_post() ? get_the_ID() : 0;
    946949
     
    960963        foreach ( $default_types as $type  )
    961964                $defaults_atts[$type] = '';
    962965
     966        if ( empty( $attr['src'] ) && ! empty( $content ) )
     967                $attr['src'] = $content;
     968
    963969        $atts = shortcode_atts( $defaults_atts, $attr, 'video' );
    964970        extract( $atts );
    965971
  • wp-includes/class-wp-embed.php

     
    137137        function shortcode( $attr, $url = '' ) {
    138138                $post = get_post();
    139139
     140                if ( ! empty( $attr['src'] ) )
     141                        $url = $attr['src'];
     142
    140143                if ( empty( $url ) )
    141144                        return '';
    142145