Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

wp_calculate_image_srcset()

3 tags 1 category

wp_calculate_image_srcset() — A helper function to calculate the image sources to include in a ‘srcset’ attribute.

Inputs: $size_array (int[]): An array of width and height values. Field $0 (int): The width in pixels. Field $1 (int): The height in pixels. $image_src (string): The ‘src’ of the image. $image_meta (array): The image meta data as returned by ‘wp_get_attachment_metadata()’. $attachment_id (int): Optional. The image attachment ID. Default 0.

Returns string|false: The ‘srcset’ attribute value. False on error or when only one source exists.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…