[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 Oct 29 21:33:24 UTC 2021


#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:  5.9
Component:  Media                                |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion has-unit-      |     Focuses:  template
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 Trying to get tests to pass I noticed two issues:
 * Test string is missing loading="lazy" (added since patch)
 * Sizes are not filtered correctly in because calls to
 `wp_calculate_image_sizes` in `wp_image_add_srcset_and_sizes` do not pass
 the image attributes, so checks like looking for the class in the test
 filters fail.

 I think a little more work is needed to make the filters work properly
 there with attributes as well if we want to consider this complete.
 @kylereicks, I know it has been a long time since you worked on this, any
 chance you want to pick it up again?

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


More information about the wp-trac mailing list