In wp_generate_attachment_metadata(), also pass $metadata to the intermediate_image_sizes_advanced filter.

Props amereservant, wonderboymusic.
Fixes #23401.


git-svn-id: https://develop.svn.wordpress.org/trunk@34007 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-10 18:03:20 +00:00
parent 09df5b81a1
commit be9cd867df

View File

@ -110,10 +110,12 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
* Filter the image sizes automatically generated when uploading an image.
*
* @since 2.9.0
* @since 4.4.0 The `$metadata` argument was addeed
*
* @param array $sizes An associative array of image sizes.
* @param array $metadata An associative array of image metadata: width, height, file.
*/
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata );
if ( $sizes ) {
$editor = wp_get_image_editor( $file );