wp_shrink_dimensions()
Устарела с версии 3.0.0. Больше не поддерживается и может быть удалена. Используйте wp_constrain_dimensions().
Calculates the new dimensions for a downsampled image.
Хуков нет.
Возвращает
Массив
. Shrunk dimensions (width, height).
Использование
wp_shrink_dimensions( $width, $height, $wmax, $hmax );
- $width(int) (обязательный)
- Current width of the image
- $height(int) (обязательный)
- Current height of the image
- $wmax(int)
- Maximum wanted width
По умолчанию: 128 - $hmax(int)
- Maximum wanted height
По умолчанию: 96
Заметки
- Смотрите: wp_constrain_dimensions()
Список изменений
С версии 2.0.0 | Введена. |
Устарела с 3.0.0 | Use wp_constrain_dimensions() |
Код wp_shrink_dimensions() wp shrink dimensions WP 6.7.2
function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { _deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' ); return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); }