[wp-trac] [WordPress Trac] #41895: wp_calculate_image_srcset filter: Improve the documentation for, or rename, this filter so it's clear it should work on an array.

WordPress Trac noreply at wordpress.org
Sat Sep 16 20:25:08 UTC 2017


#41895: wp_calculate_image_srcset filter: Improve the documentation for, or rename,
this filter so it's clear it should work on an array.
-------------------------+------------------------------
 Reporter:  johnnyb      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by Otto42):

 +1

 I agree that this is confusing. I made the same assumption that the filter
 named the same as the function would filter its output, but it's filtering
 something else here instead.

 This filter should be renamed to something else, and the original filter
 should be changed to only filter the final output. That way, any current
 users of this filter who are returning false for it will have the expected
 result instead of a potentially incorrect one.

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


More information about the wp-trac mailing list