wp_constrain_dimensions хук-фильтр . WP 4.1.0
Filters dimensions to constrain down-sampled images to.
Использование
add_filter( 'wp_constrain_dimensions', 'filter_function_name_6027', 10, 5 ); function filter_function_name_6027( $dimensions, $current_width, $current_height, $max_width, $max_height ){ // filter... return $dimensions; }
- $dimensions(число[])
An array of width and height values.
-
0(число)
The width in pixels. - 1(число)
The height in pixels.
-
- $current_width(число)
- The current width of the image.
- $current_height(число)
- The current height of the image.
- $max_width(число)
- The maximum width permitted.
- $max_height(число)
- The maximum height permitted.
Список изменений
С версии 4.1.0 | Введена. |
Где вызывается хук
wp_constrain_dimensions
wp-includes/media.php 503
return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );