A WordPress-centric search engine for devs and theme authors

wp_calculate_image_srcset_meta ›

apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id )
Parameters: (4)
  • (array) $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'.
    Required: Yes
  • (int[]) $size_array { An array of requested width and height values. @type int $0 The width in pixels. @type int $1 The height in pixels. }
    Required: Yes
  • (string) $image_src The 'src' of the image.
    Required: Yes
  • (int) $attachment_id The image attachment ID or 0 if not supplied.
    Required: Yes
Defined at:

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


$image_meta = apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id );