[wp-trac] [WordPress Trac] #31636: 4.2-beta1 - PHP warning when enqueuing script on specific pages only

WordPress Trac noreply at wordpress.org
Fri Mar 13 19:23:25 UTC 2015


#31636: 4.2-beta1 - PHP warning when enqueuing script on specific pages only
---------------------------+------------------------------
 Reporter:  harmr          |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by SergeyBiryukov):

 > {{{
 > wp_enqueue_script( array ( 'jquery', 'jquery-ui-tabs','jquery-ui-
 datepicker','jquery-ui-slider' ) );
 > wp_enqueue_script( 'jquery-ui-timepicker-addon', LEAFLET_PLUGIN_URL_ENC
 . 'inc/js/jquery-ui-timepicker-addon.js', array('jquery', 'jquery-ui-tabs
 ','jquery-ui-datepicker'), $plugin_version);
 > }}}

 The first line is redundant, you should add `'jquery-ui-slider'` to your
 second line, and that would be enough:

 `wp_enqueue_script( 'jquery-ui-timepicker-addon', LEAFLET_PLUGIN_URL_ENC .
 'inc/js/jquery-ui-timepicker-addon.js', array( 'jquery', 'jquery-ui-tabs',
 'jquery-ui-datepicker', 'jquery-ui-slider' ), $plugin_version );`

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


More information about the wp-trac mailing list