wp_calculate_image_srcset

wp_calculate_image_srcset

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('wp_calculate_image_srcset') is found 1 times:

  • /wp-includes/media.php line 1502

    * @param string $image_src The ‘src’ of the image.
    * @param array $image_meta The image meta data as returned by ‘wp_get_attachment_metadata()’.
    * @param int $attachment_id Image attachment ID or 0.
    */
    $sources = apply_filters( ‘wp_calculate_image_srcset’, $sources, $size_array, $image_src, $image_meta, $attachment_id );

    // Only return a ‘srcset’ value if there is more than one source.
    if ( ! $src_matched || ! is_array( $sources ) || count( $sources ) < 2 ) { return false; } [/php]

See this hook used in plugins: