Media: Correctly allow changing PDF thumbnail crop value.

Corrects logic that kept plugins from setting crop value of intermediate image sizes for rendered PDFs.
Adds test.

Props leemon, SergeyBiryukov, chetan200891, birgire.
Merges [42792] to the 4.9 branch.
Fixes #43226.

Built from https://develop.svn.wordpress.org/branches/4.9@42813


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mike Schroder 2018-03-09 03:21:40 +00:00
parent a91c3fbdc0
commit 7546fcc64a
2 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$sizes[ $s ]['crop'] = $_wp_additional_image_sizes[ $s ]['crop'];
} else {
// Force thumbnails to be soft crops.
if ( ! 'thumbnail' === $s ) {
if ( 'thumbnail' !== $s ) {
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.5-alpha-42811';
$wp_version = '4.9.5-alpha-42813';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.