WordPress at a glance
filter is not described

intermediate_image_sizes_advanced filter-hook . WP 2.9.0

Filters the image sizes automatically generated when uploading an image.

Usage

add_filter( 'intermediate_image_sizes_advanced', 'filter_function_name_1519', 10, 2 );
function filter_function_name_1519( $sizes, $metadata ){
	// filter...

	return $sizes;
}
$sizes(array)
An associative array of image sizes.
$metadata(array)
An associative array of image metadata: width, height, file.

Notes

  • Since 4.4.0 Added the $metadata argument.

Where the hook is called

wp_generate_attachment_metadata()
intermediate_image_sizes_advanced
wp-admin/includes/image.php 129
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata );

Where the hook is used (in WP core)

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