Make WordPress Core


Ignore:
Timestamp:
07/03/2013 08:19:00 PM (13 years ago)
Author:
nacin
Message:

Call shortcode functions directly. props kovshenin, fixes #24505.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r24446 r24547  
    23582358    elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ):
    23592359
    2360         echo do_shortcode( '[audio src="' . $att_url . '"]' );
     2360        echo wp_audio_shortcode( array( 'src' => $att_url ) );
    23612361
    23622362    elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ):
     
    23702370            $h = round( ( $meta['height'] * $w ) / $meta['width'] );
    23712371
    2372         $shortcode = sprintf( '[video src="%s"%s%s]',
    2373             $att_url,
    2374             empty( $meta['width'] ) ? '' : sprintf( ' width="%d"', $w ),
    2375             empty( $meta['height'] ) ? '' : sprintf( ' height="%d"', $h )
    2376         );
    2377         echo do_shortcode( $shortcode );
     2372        $attr = array( 'src' => $att_url );
     2373
     2374        if ( ! empty( $meta['width' ] ) )
     2375            $attr['width'] = $w;
     2376
     2377        if ( ! empty( $meta['height'] ) )
     2378            $attr['height'] = $h;
     2379
     2380        echo wp_video_shortcode( $attr );
    23782381
    23792382    endif; ?>
Note: See TracChangeset for help on using the changeset viewer.