[wp-trac] [WordPress Trac] #25017: Dont allow empty $src parameter in wp_register_script

WordPress Trac noreply at wordpress.org
Wed Dec 18 01:53:04 UTC 2013


#25017: Dont allow empty $src parameter in wp_register_script
--------------------------+---------------------
 Reporter:  oskarhane     |       Owner:  nacin
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.7
Component:  General       |     Version:  3.6
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:12 benfreke]:
 > However, if a theme runs a check of is_admin() before deregistering the
 jquery, you get a message about not using wp_deregister_script in the
 administration screen when you attempt to login (with WP_DEBUG set to
 true, obviously).

 I can't reproduce the warning as long as the correct hook
 (`login_enqueue_scripts` or `admin_enqueue_scripts`) is used, with or
 without `is_admin()` check.

 > Could I make a suggestion that the language or the error message be
 updated to reflect the fact that this check is no longer in just the
 administration?

 Feel free to open a new ticket for that, but the current text seems
 accurate enough to me, even though the login screen is not mentioned
 there. The point is to prevent developers from using `init` (as in the
 ticket description) or other incorrect hooks for `wp_deregister_script()`,
 and point them to the correct hook.

 > Ideally, pull the check completely out of the function and create a new
 function.

 That might be an unnecessary abstraction.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25017#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list