wp_image_src_get_dimensions( string $image_src, array $image_meta, int $attachment_id )

Determines an image’s width and height dimensions based on the source file.

Parameters Parameters


(string) (Required) The image source file.


(array) (Required) The image meta data as returned by 'wp_get_attachment_metadata()'.


(int) (Optional) The image attachment ID. Default 0.

Top ↑

Return Return

(array|false) Array with first element being the width and second element being the height, or false if dimensions cannot be determined.

Top ↑

Source Source

File: wp-includes/media.php


Top ↑

Changelog Changelog

Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.