Media: Correctly allow changing PDF thumbnail crop value.

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

Adds test.

Props leemon, SergeyBiryukov, chetan200891, birgire.
Fixes #43226.
Built from https://develop.svn.wordpress.org/trunk@42792


git-svn-id: http://core.svn.wordpress.org/trunk@42622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mike Schroder 2018-03-07 01:19:31 +00:00
parent 791b11bc3f
commit 51b0a3cd28
2 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,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 = '5.0-alpha-42791';
$wp_version = '5.0-alpha-42792';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.