WordPress at Your Fingertips
filter is not described

intermediate_image_sizes_advanced filter-hook . WP 2.9.0

Filters the image sizes automatically generated when uploading an image.


add_filter( 'intermediate_image_sizes_advanced', 'filter_function_name_8117', 10, 3 );
function filter_function_name_8117( $new_sizes, $image_meta, $attachment_id ){
	// filter...

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


Since 2.9.0 Introduced.
Since 4.4.0 Added the $image_meta argument.
Since 5.3.0 Added the $attachment_id argument.

Where the hook is called

wp-admin/includes/image.php 364
$new_sizes = apply_filters( 'intermediate_image_sizes_advanced', $new_sizes, $image_meta, $attachment_id );

Where in WP core the hook is used WordPress

wp-admin/includes/ajax-actions.php 3918
add_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );
wp-admin/includes/ajax-actions.php 3920
remove_filter( 'intermediate_image_sizes_advanced', array( $wp_site_icon, 'additional_sizes' ) );