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:
parent
a776bcb14d
commit
bda3b4c53d
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue