wp_calculate_image_srcset_meta WordPress Filter Hook

The wp_calculate_image_srcset_meta hook is used to calculate the image srcset meta data for a given image attachment. This hook is called by the wp_calculate_image_srcset() function.

apply_filters( 'wp_calculate_image_srcset_meta', array $image_meta, int[] $size_array, string $image_src, int $attachment_id ) #

Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data.


Parameters

$image_meta

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

$size_array

(int[])An array of requested width and height values.

  • (int) The width in pixels.
  • '1'
    (int) The height in pixels.

$image_src

(string)The 'src' of the image.

$attachment_id

(int)The image attachment ID or 0 if not supplied.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More