diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 932066c553..796efe7540 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -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 );