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

git-svn-id: http://core.svn.wordpress.org/trunk@22667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-19 06:56:54 +00:00
parent a776bcb14d
commit bda3b4c53d

View File

@ -1030,7 +1030,7 @@ function post_thumbnail_meta_box( $post ) {
};
$element.on( 'click', '.choose, img', function( event ) {
var options, thumbnailId;
var options, thumbnailId, attachment;
event.preventDefault();
@ -1047,8 +1047,11 @@ function post_thumbnail_meta_box( $post ) {
};
thumbnailId = $thumbnailId.val();
if ( '' !== thumbnailId && -1 !== thumbnailId )
options.selection = [ Attachment.get( thumbnailId ) ];
if ( '' !== thumbnailId && -1 !== thumbnailId ) {
attachment = Attachment.get( thumbnailId );
attachment.fetch();
options.selection = [ attachment ];
}
frame = wp.media( options );