diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 3bb1cc66ca..0f0b5d64cc 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -98,7 +98,8 @@ foreach ( get_object_taxonomies('post') as $tax_name ) { } add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core'); -add_meta_box('postthumbnaildiv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low'); +if ( current_theme_supports( 'post-thumbnails' ) ) + add_meta_box('postthumbnaildiv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low'); add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core'); add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core'); add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core'); diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index cdf0a7303f..9b6dd58543 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -80,7 +80,8 @@ add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'pag add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core'); add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core'); add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core'); -add_meta_box('postthumbnaildiv', __('Page Thumbnail'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); +if ( current_theme_supports( 'post-thumbnails' ) ) + add_meta_box('postthumbnaildiv', __('Page Thumbnail'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 9fb259cd0e..e611287dc3 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1068,17 +1068,6 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { * @return string html */ function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { - global $post; - if ( !current_theme_supports( 'post-thumbnails' ) ) { - if ( 'post' == $post->post_type ) { - $type = __( 'post' ); - } elseif ( 'page' == $post->post_type ) { - $type = __( 'page' ); - } else { - $type = $post->post_type; - } - return sprintf( __( '
Your theme does not currently support %2$s thumbnails.
You can hide this module by clicking the "Screen Options" tab.
' ), _x( 'http://codex.wordpress.org/Post_Images', 'Within the post/page thumbnail module on the post/page edit screen' ), $type ); - } $content = ' '; if ( $thumbnail_id && get_post( $thumbnail_id ) ) {