Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_constrain_dimensions()

3 tags 1 category

wp_constrain_dimensions() — Calculates the new dimensions for a down-sampled image. If either width or height are empty, no constraint is applied on that dimension.

Inputs: $current_width (int): Current width of the image. $current_height (int): Current height of the image. $max_width (int): Optional. Max width in pixels to constrain to. Default 0. $max_height (int): Optional. Max height in pixels to constrain to. Default 0.

Returns int[]: An array of width and height values. Field $0 (int): The width in pixels. Field $1 (int): The height in pixels.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…