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: https://develop.svn.wordpress.org/trunk@22667 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1b42cd449c
commit
1fb6abded8
@ -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
Block a user