Make WordPress Core

Changeset 29281


Ignore:
Timestamp:
07/24/2014 06:03:58 PM (10 years ago)
Author:
helen
Message:

Set default values for attachment meta and ID3 data when preparing for JS to avoid errors in rendering templates. props ericmann for the initial patch. fixes #29013.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r29280 r29281  
    326326                <# } #>
    327327
    328                 <# if ( 'audio' === data.type && data.meta && data.meta.bitrate ) { #>
     328                <# if ( 'audio' === data.type && data.meta.bitrate ) { #>
    329329                    <div class="bitrate">
    330330                        <strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s
  • trunk/src/wp-includes/media.php

    r29271 r29281  
    26292629        ),
    26302630        'editLink'   => false,
     2631        'meta'       => false,
    26312632    );
    26322633
     
    27262727        $response['meta'] = array();
    27272728        foreach ( wp_get_attachment_id3_keys( $attachment, 'js' ) as $key => $label ) {
     2729            $response['meta'][ $key ] = false;
     2730
    27282731            if ( ! empty( $meta[ $key ] ) ) {
    27292732                $response['meta'][ $key ] = $meta[ $key ];
Note: See TracChangeset for help on using the changeset viewer.