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.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

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:1732wp_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.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

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

About this page

Parsed data
Generated from the wordpress-develop 6.7.10 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.