set_post_thumbnail_size

The timeline below displays how wordpress function set_post_thumbnail_size has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Registers an image size for the post thumbnail.
 *
 * @since 2.9.0
 *
 * @see add_image_size() for details on cropping behavior.
 *
 * @param int        $width  Image width in pixels.
 * @param int        $height Image height in pixels.
 * @param 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:
 *
 *     @type string $0 The x crop position. Accepts 'left' 'center', or 'right'.
 *     @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'.
 * }
 */
function set_post_thumbnail_size($width = 0, $height = 0, $crop = false)
{
    add_image_size('post-thumbnail', $width, $height, $crop);
}

WordPress Version: 4.4

/**
 * Registers an image size for the post thumbnail.
 *
 * @since 2.9.0
 *
 * @see add_image_size() for details on cropping behavior.
 *
 * @param int        $width  Image width in pixels.
 * @param int        $height Image height in pixels.
 * @param bool|array $crop   Optional. Whether to crop images to specified width and height or resize.
 *                           An array can specify positioning of the crop area. Default false.
 */
function set_post_thumbnail_size($width = 0, $height = 0, $crop = false)
{
    add_image_size('post-thumbnail', $width, $height, $crop);
}

WordPress Version: 4.1

/**
 * Registers an image size for the post thumbnail.
 *
 * @since 2.9.0
 *
 * @see add_image_size() for details on cropping behavior.
 *
 * @param int        $width  Image width in pixels.
 * @param int        $height Image height in pixels.
 * @param bool|array $crop   Optional. Whether to crop images to specified height and width or resize.
 *                           An array can specify positioning of the crop area. Default false.
 */
function set_post_thumbnail_size($width = 0, $height = 0, $crop = false)
{
    add_image_size('post-thumbnail', $width, $height, $crop);
}

WordPress Version: 3.9

/**
 * Registers an image size for the post thumbnail.
 *
 * @since 2.9.0
 * @see add_image_size() for details on cropping behavior.
 *
 * @param int        $width  Image width in pixels.
 * @param int        $height Image height in pixels.
 * @param bool|array $crop   Optional. Whether to crop images to specified height and width or resize.
 *                           An array can specify positioning of the crop area. Default false.
 * @return bool|array False, if no image was created. Metadata array on success.
 */
function set_post_thumbnail_size($width = 0, $height = 0, $crop = false)
{
    add_image_size('post-thumbnail', $width, $height, $crop);
}

WordPress Version: 3.7

/**
 * Registers an image size for the post thumbnail
 *
 * @since 2.9.0
 */
function set_post_thumbnail_size($width = 0, $height = 0, $crop = false)
{
    add_image_size('post-thumbnail', $width, $height, $crop);
}