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.


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

	return $dimensions;

An array of width and height values.

  • $0 (int)
    The width in pixels.

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


Since 4.1.0 Introduced.

Where the hook is called

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

Where in WP core the hook is used

Usage not found!