diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php
index 254ba7d90f..0e081266bc 100644
|
a
|
b
|
function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
| 160 | 160 | $metadata = wp_read_audio_metadata( $file ); |
| 161 | 161 | $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) || post_type_supports( 'attachment:audio', 'thumbnail' ); |
| 162 | 162 | } |
| | 163 | |
| | 164 | /** |
| | 165 | * Filters the mime types that have support for thumbnail generation |
| | 166 | * |
| | 167 | * @param array $other_supported_mime_types An array of supported MIME types |
| | 168 | */ |
| | 169 | $other_supported_mime_types = apply_filters( 'mime_types_thumbnail_generation', array( 'application/pdf' ) ); |
| 163 | 170 | |
| 164 | 171 | if ( $support && ! empty( $metadata['image']['data'] ) ) { |
| 165 | 172 | // Check for existing cover. |
| … |
… |
function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
| 216 | 223 | } |
| 217 | 224 | } |
| 218 | 225 | } // Try to create image thumbnails for PDFs |
| 219 | | elseif ( 'application/pdf' === $mime_type ) { |
| | 226 | elseif ( in_array( $mime_type, $other_supported_mime_types, true ) ) { |
| 220 | 227 | $fallback_sizes = array( |
| 221 | 228 | 'thumbnail', |
| 222 | 229 | 'medium', |