WordPress at a glance
function is not described

_wp_get_image_size_from_meta() WP 4.4.0

Get the image size as array from its meta data.

Used for responsive images.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.


Array|false. Array of width and height or false if the size isn't present in the meta data.


_wp_get_image_size_from_meta( $size_name, $image_meta );
$size_name(string) (required)
Image size. Accepts any registered image size name.
$image_meta(array) (required)
The image meta data.


Since 4.4.0 Introduced.

Code of _wp_get_image_size_from_meta() WP 5.7

function _wp_get_image_size_from_meta( $size_name, $image_meta ) {
	if ( 'full' === $size_name ) {
		return array(
			absint( $image_meta['width'] ),
			absint( $image_meta['height'] ),
	} elseif ( ! empty( $image_meta['sizes'][ $size_name ] ) ) {
		return array(
			absint( $image_meta['sizes'][ $size_name ]['width'] ),
			absint( $image_meta['sizes'][ $size_name ]['height'] ),

	return false;