WPDev.one
Core Function
View Source on Trac ↗

image_get_intermediate_size()

image_get_intermediate_size( mixed $post_id, mixed $size = 'thumbnail' )

Retrieves the image's intermediate size (resized) path, width, and height.

Parameters 2 required

Name / Type Description
$post_id
int

Attachment ID.

Required
mixed

(string | int[]) $size Optional. Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). Default 'thumbnail'.

Required

Return Value

((array)
(array | false) { Array of file relative path, width, and height on success. Additionally includes absolute path and URL if registered size is passed to `$size` parameter. False on failure.

Function Information

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