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

WordPress Trac noreply at wordpress.org
Mon Dec 11 09:09:40 UTC 2017


#42867: HTML Widget: toggleClass() should be passed true/false as second param
--------------------------+-----------------------------
 Reporter:  iCaleb        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 http://api.jquery.com/toggleclass/

 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.

 Found the problem here:
 https://github.com/WordPress/WordPress/blob/4.9-branch/wp-admin/js/widgets
 /custom-html-widgets.js#L207, with correct usage found here:
 https://github.com/WordPress/WordPress/blob/4.9-branch/wp-admin/js/theme-
 plugin-editor.js#L365

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


More information about the wp-trac mailing list