wp_image_src_get_dimensions


wp_image_src_get_dimensions ( $image_src, $image_meta, $attachment_id = 0 )

Parameters:
  • (string) image_src The image source file.
  • (array) image_meta The image meta data as returned by 'wp_get_attachment_metadata()'.
  • (int) attachment_id Optional. The image attachment ID. Default 0.
Returns:
  • (array|false) Array with first element being the width and second element being the height, or false if dimensions cannot be determined.
Defined at:

Description

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

Related Functions

image_resize_dimensions, wp_image_add_srcset_and_sizes, wp_shrink_dimensions, wp_constrain_dimensions, wp_expand_dimensions

Top Google Results

User discussions

wpseek mobile