intermediate_image_sizes хук-фильтрWP 2.5.0

Filters the list of intermediate image sizes.

Использование

add_filter( 'intermediate_image_sizes', 'wp_kama_intermediate_image_sizes_filter' );

/**
 * Function for `intermediate_image_sizes` filter-hook.
 * 
 * @param string[] $default_sizes An array of intermediate image size names.
 *
 * @return string[]
 */
function wp_kama_intermediate_image_sizes_filter( $default_sizes ){

	// filter...
	return $default_sizes;
}
$default_sizes(string[])
An array of intermediate image size names.
По умолчанию: are 'thumbnail', 'medium', 'medium_large', 'large'

Список изменений

С версии 2.5.0 Введена.

Где вызывается хук

get_intermediate_image_sizes()
intermediate_image_sizes
wp-includes/media.php 875
return apply_filters( 'intermediate_image_sizes', $default_sizes );

Где используется хук в WordPress

wp-admin/includes/class-wp-site-icon.php 227
add_filter( 'intermediate_image_sizes', array( $this, 'intermediate_image_sizes' ) );