[wp-trac] [WordPress Trac] #29834: jQuery UI admin files cannot be changed by plugins if SCRIPT_DEBUG is off

WordPress Trac noreply at wordpress.org
Thu Oct 2 13:53:11 UTC 2014


#29834: jQuery UI admin files cannot be changed by plugins if SCRIPT_DEBUG is off
--------------------------------+-----------------------------
 Reporter:  Fab1en              |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  External Libraries  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  javascript          |
--------------------------------+-----------------------------
 I was trying to replace jQuery UI core files to use a more recent version,
 when I realized that `SCRIPT_DEBUG` must be `true` to make this work.

 Here is the code I use :

 {{{
 add_action('wp_default_scripts', 'jqui_update_register', 10, 1);
 function jqui_update_register($scripts){
         $scripts->remove( 'jquery-ui-draggable' );
         $scripts->add( 'jquery-ui-draggable',
 plugins_url('js/jquery.ui.draggable.min.js', __FILE__ ), array('jquery-ui-
 core', 'jquery-ui-mouse'), '1.11.1', 1 );
         // add plugin dir to the default list
         $scripts->default_dirs[] = plugins_url("js/", __FILE__ );
 }
 }}}

 The issue is that core js files are loaded via `wp-admin/load-scripts.php`
 where actions and filters are disabled (for performance reasons ?).

 Changeset [23378] makes it more difficult to accidentally or negligently
 deregister critical scripts in the admin, but does it does not prevent it
 completely.

 I am doing it wrong ? Is it the intended behavior, or is it a bug ? If it
 is intended, it's tricky, because developers usually test their work with
 SCRIPT_DEBUG on.

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


More information about the wp-trac mailing list