[wp-trac] [WordPress Trac] #42867: HTML Widget: toggleClass() should be passed true/false as second param

WordPress Trac noreply at wordpress.org
Mon Jan 15 23:37:47 UTC 2018


#42867: HTML Widget: toggleClass() should be passed true/false as second param
-------------------------------------+--------------------------
 Reporter:  iCaleb                   |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  reviewing
 Priority:  normal                   |   Milestone:  4.9.2
Component:  Widgets                  |     Version:  4.9
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+--------------------------

Comment (by SergeyBiryukov):

 Replying to [ticket:42867 iCaleb]:
 > It expects either true or false for the second parameter, passing an
 integer will just toggle on/off which is sometimes not the desired result.

 Confirmed, `toggleClass( ..., 0 )` is not the same as `toggleClass( ...,
 false )`, and just acts as a regular toggle. Likewise, `toggleClass( ...,
 1 )` is not the same as `toggleClass( ..., true )`.

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


More information about the wp-trac mailing list