Bring Featured Images back into the main media dialog.

Most users don't realize that the Featured Image meta box exists; if they do, few use it.

Restores the old meta box UI, including the admin_post_thumbnail_html filter. If a plugin is using _wp_post_thumbnail_html() in conjunction with Thickbox elsewhere, it will also magically still work.

Specific underlying changes:
 * Converts the modal view to use the view manager, which means that a call to open() will automatically call render and attach if necessary.
 * Doesn't automatically set a state in wp.media, to allow code to customize the states to be added before activation.

props koopersmith.
fixes #21776.



git-svn-id: http://core.svn.wordpress.org/trunk@22979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2012-12-03 02:38:10 +00:00
parent 336feff008
commit 5d0933d884
10 changed files with 248 additions and 212 deletions

View File

@@ -199,14 +199,6 @@ function edit_post( $post_data = null ) {
set_post_format( $post_ID, false );
}
// Featured Images
if ( isset( $post_data['thumbnail_id'] ) ) {
if ( '-1' == $post_data['thumbnail_id'] )
delete_post_thumbnail( $post_ID );
else
set_post_thumbnail( $post_ID, $post_data['thumbnail_id'] );
}
// Meta Stuff
if ( isset($post_data['meta']) && $post_data['meta'] ) {
foreach ( $post_data['meta'] as $key => $value ) {