Ticket #27460: 27460.diff
File 27460.diff, 4.2 KB (added by , 7 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
24 24 $user_ID = isset($user_ID) ? (int) $user_ID : 0; 25 25 $action = isset($action) ? $action : ''; 26 26 27 $media_type = false; 28 if ( 'attachment' === $post_type && $post_ID ) { 29 $post = get_post( $post_ID ); 30 $media_type = post_supports_thumbnails( $post ); 31 } 27 $media_support = theme_supports_thumbnails( $post ) || post_supports_thumbnails( $post ); 32 28 33 if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_ type) {29 if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_support ) { 34 30 add_thickbox(); 35 31 wp_enqueue_media( array( 'post' => $post_ID ) ); 36 32 } … … 169 165 if ( post_type_supports($post_type, 'page-attributes') ) 170 166 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 171 167 172 $audio_post_support = $video_post_support = false; 173 $theme_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ); 174 if ( 'attachment' === $post_type && ! empty( $post->post_mime_type ) ) { 175 $audio_post_support = 0 === strpos( $post->post_mime_type, 'audio/' ) && current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' ); 176 $video_post_support = 0 === strpos( $post->post_mime_type, 'video/' ) && current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' ); 177 } 178 179 if ( $theme_support || $audio_post_support || $video_post_support ) 168 if ( current_theme_supports( 'post-thumbnails', $post_type ) || post_supports_thumbnails( $post ) ) 180 169 add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low'); 181 170 182 171 if ( post_type_supports($post_type, 'excerpt') ) -
src/wp-admin/includes/image.php
127 127 128 128 } elseif ( preg_match( '#^video/#', get_post_mime_type( $attachment ) ) ) { 129 129 $metadata = wp_read_video_metadata( $file ); 130 $support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) &&post_type_supports( 'attachment:video', 'thumbnail' );130 $support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) || post_type_supports( 'attachment:video', 'thumbnail' ); 131 131 } elseif ( preg_match( '#^audio/#', get_post_mime_type( $attachment ) ) ) { 132 132 $metadata = wp_read_audio_metadata( $file ); 133 $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) &&post_type_supports( 'attachment:audio', 'thumbnail' );133 $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' ); 134 134 } 135 135 136 136 if ( $support && ! empty( $metadata['image']['data'] ) ) { -
src/wp-includes/media.php
2445 2445 'nonce' => wp_create_nonce( 'update-post_' . $post->ID ), 2446 2446 ); 2447 2447 2448 if ( theme_supports_thumbnails( $post ) &&post_supports_thumbnails( $post ) ) {2448 if ( theme_supports_thumbnails( $post ) || post_supports_thumbnails( $post ) ) { 2449 2449 $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true ); 2450 2450 $settings['post']['featuredImageId'] = $featured_image_id ? $featured_image_id : -1; 2451 2451 } -
src/wp-includes/post.php
74 74 'delete_with_user' => true, 75 75 'supports' => array( 'title', 'author', 'comments' ), 76 76 ) ); 77 add_post_type_support( 'attachment:audio', 'thumbnail' ); 78 add_post_type_support( 'attachment:video', 'thumbnail' ); 77 79 78 80 register_post_type( 'revision', array( 79 81 'labels' => array(