WPDev.one
Core Function
View Source on Trac ↗

add_image_size()

add_image_size( mixed $name, mixed $width = 0, mixed $height = 0, mixed $crop = false )

Registers a new image size.

Parameters 2 required

Name / Type Description
$name
string

Image size identifier.

Required
$width
int

Optional. Image width in pixels. Default 0.

$height
int

Optional. Image height in pixels. Default 0.

mixed

(bool | array) $crop { Optional. Image cropping behavior. If false, the image will be scaled (default). If true, image will be cropped to the specified dimensions using center positions. If an array, the image will be cropped using the array to specify the crop location:

Required

Return Value

(void)
No return value description available.

Function Information

Since Version
2.9.0
Source File
wp-includes/media.php
Advertisement