wp_expand_dimensions()
Based on a supplied width/height example, returns the biggest possible dimensions based on the max width/height.
Хуков нет.
Возвращает
int[]
. An array of maximum width and height values.
Использование
wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height );
- $example_width(int) (обязательный)
- The width of an example embed.
- $example_height(int) (обязательный)
- The height of an example embed.
- $max_width(int) (обязательный)
- The maximum allowed width.
- $max_height(int) (обязательный)
- The maximum allowed height.
Заметки
- Смотрите: wp_constrain_dimensions()
Список изменений
С версии 2.9.0 | Введена. |
Код wp_expand_dimensions() wp expand dimensions WP 6.5.2
function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) { $example_width = (int) $example_width; $example_height = (int) $example_height; $max_width = (int) $max_width; $max_height = (int) $max_height; return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height ); }