Switch language
wpseek on Twitter


A WordPress-centric search engine for devs and theme authors




add_image_size [ ]

add_image_size ( $name, $width = 0, $height = 0, $crop = false )
Defined at:
Codex



Registers a new image size

Source

function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
	global $_wp_additional_image_sizes;
	$_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => (bool) $crop );
}

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

1 User Note(s)

Gravatar
Most people wonders why add a new iamge size doesn't scale the current images, this is not a bug or mal-fucntions. The function only will create the new sizes for images sent after adding the new size, old imagens need to be rebuld.

Add New ...