Make WordPress Core

Changeset 22667


Ignore:
Timestamp:
11/19/2012 06:56:54 AM (12 years ago)
Author:
koopersmith
Message:

Media: Properly display selected featured image data if the featured image is not in the first section of the library. see #22494, #21390.

File:
1 edited

Legend:

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

    r22561 r22667  
    10311031
    10321032        $element.on( 'click', '.choose, img', function( event ) {
    1033             var options, thumbnailId;
     1033            var options, thumbnailId, attachment;
    10341034
    10351035            event.preventDefault();
     
    10481048
    10491049            thumbnailId = $thumbnailId.val();
    1050             if ( '' !== thumbnailId && -1 !== thumbnailId )
    1051                 options.selection = [ Attachment.get( thumbnailId ) ];
     1050            if ( '' !== thumbnailId && -1 !== thumbnailId ) {
     1051                attachment = Attachment.get( thumbnailId );
     1052                attachment.fetch();
     1053                options.selection = [ attachment ];
     1054            }
    10521055
    10531056            frame = wp.media( options );
Note: See TracChangeset for help on using the changeset viewer.