Turn on thumbnail support for attachment:audio and attachment:video. Change conditionals to check for theme OR post type support when determining whether to turn on the Featured Image UI pieces in the admin.
Fixes #27460. Built from https://develop.svn.wordpress.org/trunk@27657 git-svn-id: http://core.svn.wordpress.org/trunk@27500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -127,10 +127,10 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
||||
|
||||
} elseif ( preg_match( '#^video/#', get_post_mime_type( $attachment ) ) ) {
|
||||
$metadata = wp_read_video_metadata( $file );
|
||||
$support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' );
|
||||
$support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) || post_type_supports( 'attachment:video', 'thumbnail' );
|
||||
} elseif ( preg_match( '#^audio/#', get_post_mime_type( $attachment ) ) ) {
|
||||
$metadata = wp_read_audio_metadata( $file );
|
||||
$support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' );
|
||||
$support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' );
|
||||
}
|
||||
|
||||
if ( $support && ! empty( $metadata['image']['data'] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user