From 186f963c34e64aba15294e1416a598533809ba21 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 16 Dec 2017 13:46:28 +0000 Subject: [PATCH] Media: Pass the attachment ID to the `intermediate_image_sizes_advanced` filter. Props drywallbmb, robbie505 Fixes 42745 git-svn-id: https://develop.svn.wordpress.org/trunk@42407 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 3fe8cc8e69..4b66a5d36f 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -130,11 +130,13 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { * * @since 2.9.0 * @since 4.4.0 Added the `$metadata` argument. + * @since 5.0.0 Added the `$attachment_id` argument. * - * @param array $sizes An associative array of image sizes. - * @param array $metadata An associative array of image metadata: width, height, file. + * @param array $sizes An associative array of image sizes. + * @param array $metadata An associative array of image metadata: width, height, file. + * @param int $attachment_id Current attachment ID. */ - $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata ); + $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata, $attachment_id ); if ( $sizes ) { $editor = wp_get_image_editor( $file );