wppaste
WordPress

apply_filters( 'wp_image_src_get_dimensions', array|false $dimensions, string $image_src, array $image_meta, int $attachment_id )

Since
5.7.0
Filters the wp_image_src_get_dimensions() value.

Compatibility

WordPress
since 5.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$dimensionsarray|false
Array with first element being the width and second element being the height, or false if dimensions could not be determined.
$image_srcstring
The image source file.
$image_metaarray
The image meta data as returned by 'wp_get_attachment_metadata()'.
$attachment_idint
The image attachment ID. Default 0.

Where this hook fires · 1

  • wp-includes/media.php:1858wp_image_src_get_dimensions()

Source code

	 *                                   false if dimensions could not be determined.	 * @param string      $image_src     The image source file.	 * @param array       $image_meta    The image meta data as returned by	 *                                   'wp_get_attachment_metadata()'.	 * @param int         $attachment_id The image attachment ID. Default 0.	 */	return apply_filters( 'wp_image_src_get_dimensions', $dimensions, $image_src, $image_meta, $attachment_id );} /** * Adds 'srcset' and 'sizes' attributes to an existing 'img' element. * * @since 4.4.0

Changelog

Introduced in 5.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.