W3cubDocs

/WordPress

apply_filters( ‘intermediate_image_sizes_advanced’, array $new_sizes, array $image_meta, int $attachment_id )

Filters the image sizes automatically generated when uploading an image.

Parameters

$new_sizesarray
Associative array of image sizes to be created.
$image_metaarray
The image meta data: width, height, file, sizes, etc.
$attachment_idint
The attachment post ID for the image.

Source

$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id );

Changelog

Version Description
5.3.0 Added the $attachment_id argument.
4.4.0 Added the $image_meta argument.
2.9.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/intermediate_image_sizes_advanced