[wp-trac] [WordPress Trac] #36982: Add image attributes and additional context to the wp_calculate_image_srcset and wp_calculate_image_sizes filters

WordPress Trac noreply at wordpress.org
Fri Aug 21 09:10:19 UTC 2020


#36982: Add image attributes and additional context to the
wp_calculate_image_srcset and wp_calculate_image_sizes filters
-----------------------------------+------------------------------
 Reporter:  kylereicks             |       Owner:  adamsilverstein
     Type:  enhancement            |      Status:  assigned
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Media                  |     Version:  4.6
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  template
-----------------------------------+------------------------------

Comment (by strarsis):

 Currently, I have to resort to either the ratio (when hard crop is used
 for that particular image size) or other tricks to deduce the usage of a
 particular image in the `wp_calculate_image_sizes` filter.
 Basically the usage context of the image has to be "encoded" as image size
 dimensions or ratio, there are no other means. Just knowing the
 markup/Gutenberg block the image is used in would help tremendously.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/36982#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list