[wp-trac] [WordPress Trac] #34931: Adding a filter to modify ratio differs when generating img srcset

WordPress Trac noreply at wordpress.org
Wed Dec 9 10:01:17 UTC 2015


#34931: Adding a filter to modify ratio differs when generating img srcset
-------------------------+------------------------------
 Reporter:  mbcreation   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  4.4
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------
Changes (by swissspidy):

 * type:  feature request => enhancement


Comment:

 Hi there, welcome to trac then!

 I'll leave it to others to decide whether this filter makes sense.

 From a code point of view I'd suggest you to follow the
 [https://make.wordpress.org/core/handbook/best-practices/inline-
 documentation-standards/php/#4-hooks-actions-and-filters inline
 documentation standards] for filters. Perhaps putting `$ratio_diff`=
 apply_filters( 'max_srcset_image_diff_ratio', 0.002 )` on a new line for
 increased readability.

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


More information about the wp-trac mailing list