Don't show featured images for image attachments. Remove abstractions for now.

fixes #27673.

Built from https://develop.svn.wordpress.org/trunk@28051


git-svn-id: http://core.svn.wordpress.org/trunk@27881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2014-04-08 17:40:28 +00:00
parent 4d6fcfdba1
commit e8da400c69
2 changed files with 20 additions and 46 deletions

View File

@@ -24,9 +24,16 @@ $post_ID = isset($post_ID) ? (int) $post_ID : 0;
$user_ID = isset($user_ID) ? (int) $user_ID : 0;
$action = isset($action) ? $action : '';
$media_support = theme_supports_thumbnails( $post ) || post_supports_thumbnails( $post );
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
} elseif ( 0 === strpos( $post->post_mime_type, 'video/' ) ) {
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
}
}
if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_support ) {
if ( $thumbnail_support ) {
add_thickbox();
wp_enqueue_media( array( 'post' => $post_ID ) );
}
@@ -169,7 +176,7 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) {
if ( post_type_supports($post_type, 'page-attributes') )
add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
if ( current_theme_supports( 'post-thumbnails', $post_type ) || post_supports_thumbnails( $post ) )
if ( $thumbnail_support )
add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
if ( post_type_supports($post_type, 'excerpt') )