wppaste
WordPress

apply_filters( 'wp_image_file_matches_image_meta', bool $match, string $image_location, array $image_meta, int $attachment_id )

Since
5.5.0
Filters whether an image path or URI matches image meta.

Compatibility

WordPress
since 5.5.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

$matchbool
Whether the image relative path from the image meta matches the end of the URI or path to the image file.
$image_locationstring
Full path or URI to the tested image file.
$image_metaarray
The image meta data as returned by 'wp_get_attachment_metadata()'.
$attachment_idint
The image attachment ID or 0 if not supplied.

Where this hook fires · 1

  • wp-includes/media.php:1721wp_image_file_matches_image_meta()

Source code

	 * @param bool   $match          Whether the image relative path from the image meta	 *                               matches the end of the URI or path to the image file.	 * @param string $image_location Full path or URI to the tested image file.	 * @param array  $image_meta     The image meta data as returned by 'wp_get_attachment_metadata()'.	 * @param int    $attachment_id  The image attachment ID or 0 if not supplied.	 */	return apply_filters( 'wp_image_file_matches_image_meta', $match, $image_location, $image_meta, $attachment_id );} /** * Determines an image's width and height dimensions based on the source file. * * @since 5.5.0

Changelog

Introduced in 5.5.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.0.4 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.