WordPress at a glance
filter is not described

wp_constrain_dimensions filter-hook . WP 4.1.0

Filters dimensions to constrain down-sampled images to.

Usage

add_filter( 'wp_constrain_dimensions', 'filter_function_name_5787', 10, 5 );
function filter_function_name_5787( $dimensions, $current_width, $current_height, $max_width, $max_height ){
	// filter...

	return $dimensions;
}
$dimensions(int[])

An array of width and height values.

  • 0(int)
    The width in pixels.

  • 1(int)
    The height in pixels.
$current_width(int)
The current width of the image.
$current_height(int)
The current height of the image.
$max_width(int)
The maximum width permitted.
$max_height(int)
The maximum height permitted.

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

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

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

wp_constrain_dimensions()
wp_constrain_dimensions
wp-includes/media.php 504
return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );

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

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