wppaste
WordPress

apply_filters( 'intermediate_image_sizes_advanced', array $new_sizes, array $image_meta, int $attachment_id )

Since
2.9.0, 4.4.0, 5.3.0
Filters the image sizes automatically generated when uploading an image.

Compatibility

WordPress
since 5.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

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.

Where this hook fires · 1

  • wp-admin/includes/image.php:410wp_create_image_subsizes()

Source code

	 * @since 5.3.0 Added the `$attachment_id` argument.	 *	 * @param array $new_sizes     Associative array of image sizes to be created.	 * @param array $image_meta    The image meta data: width, height, file, sizes, etc.	 * @param int   $attachment_id The attachment post ID for the image.	 */	$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id ); 	return _wp_make_subsizes( $new_sizes, $file, $image_meta, $attachment_id );} /** * Low-level function to create image sub-sizes.

Changelog

Introduced in 2.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

5.3.0
Added the $attachment_id argument.from the docblock
4.4.0
Added the $image_meta argument.from the docblock
2.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.