Make WordPress Core


Ignore:
Timestamp:
04/08/2014 05:39:58 PM (11 years ago)
Author:
nacin
Message:

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

fixes #27673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r28029 r28051  
    2525$action = isset($action) ? $action : '';
    2626
    27 $media_support = theme_supports_thumbnails( $post ) || post_supports_thumbnails( $post );
    28 
    29 if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_support ) {
     27$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
     28if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
     29    if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
     30        $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
     31    } elseif ( 0 === strpos( $post->post_mime_type, 'video/' ) ) {
     32        $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
     33    }
     34}
     35
     36if ( $thumbnail_support ) {
    3037    add_thickbox();
    3138    wp_enqueue_media( array( 'post' => $post_ID ) );
     
    170177    add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
    171178
    172 if ( current_theme_supports( 'post-thumbnails', $post_type ) || post_supports_thumbnails( $post ) )
     179if ( $thumbnail_support )
    173180    add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
    174181
Note: See TracChangeset for help on using the changeset viewer.