set_post_thumbnail_size

Advertisement

Summery Summery

Registers an image size for the post thumbnail.

Syntax Syntax

set_post_thumbnail_size( int $width, int $height, bool|array $crop = false )

Parameters Parameters

$width

(Required) Image width in pixels.

$height

(Required) Image height in pixels.

$crop

(Optional) Whether to crop images to specified width and height or resize. An array can specify positioning of the crop area.

Default value: false

Source Source

File: wp-includes/media.php

function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
	add_image_size( 'post-thumbnail', $width, $height, $crop );
}

Advertisement

Changelog Changelog

Changelog
Version Description
2.9.0 Introduced.

See also See also

Advertisement

Leave a Reply