[wp-trac] [WordPress Trac] #16024: Conditional Comments for JS

WordPress Trac noreply at wordpress.org
Sat Jan 17 04:40:57 UTC 2015


#16024: Conditional Comments for JS
--------------------------------------------------+-----------------------
 Reporter:  filosofo                              |       Owner:  azaozz
     Type:  enhancement                           |      Status:  reopened
 Priority:  normal                                |   Milestone:  4.2
Component:  Script Loader                         |     Version:  3.1
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch needs-testing dev-feedback  |     Focuses:  template
--------------------------------------------------+-----------------------
Changes (by nacin):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Two minor things based on reviewing [31223]:

  * That single test should be broken up into multiple tests. A good rule
 of thumb is one assertion per test. Obviously, multiple assertions testing
 the same thing are OK. A general example would be asserting that the array
 length is 3 and that it contains X key. An example specific to this would
 be to assert the printed scripts then confirm there is nothing left to
 print.

  * wp_script_add_data() has the potential to replace wp_localize_script().
 Is there some kind of method signature that would be ideal to replace
 wp_localize_script() that the current signature would prevent? Thinking
 forwards compatibility here.

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


More information about the wp-trac mailing list