From 81cfe7488c2bc8e9c1d51e41e92e0bab1764cc19 Mon Sep 17 00:00:00 2001 From: antpb Date: Wed, 28 Aug 2024 17:01:13 +0000 Subject: [PATCH] Media: Implement fallback to full-size thumbnails for PDFs in Media Library. When medium-size thumbnails are disabled, PDF previews in the Media Library grid view now fall back to displaying full-size thumbnails instead of a generic document icon. Props daleharrison, kushang78, mukesh27, sudipatel007, mai21, antpb. Fixes #39630. Built from https://develop.svn.wordpress.org/trunk@58947 git-svn-id: http://core.svn.wordpress.org/trunk@58343 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media-template.php | 8 ++++++-- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 0186520030..3a9bd723ba 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -605,8 +605,12 @@ function wp_print_media_templates() {
<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> - <# } else if ( data.sizes && data.sizes.medium ) { #> - + <# } else if ( data.sizes ) { + if ( data.sizes.medium ) { #> + + <# } else { #> + + <# } #> <# } else { #> <# } #> diff --git a/wp-includes/version.php b/wp-includes/version.php index b1b529a538..1f072f141b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58946'; +$wp_version = '6.7-alpha-58947'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.