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

WordPress Trac noreply at wordpress.org
Tue Aug 13 19:16:00 UTC 2013


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

Comment (by oskarhane):

 Replying to [comment:4 nacin]:
 > Technically speaking, you can create an alias or group via an empty
 'src'. As in, specify a handle and then say it has dependencies of X, Y,
 and Z. Enqueueing this one script then gives you X, Y, and Z. We use this
 a tiny bit in core.
 >
 > Perhaps the bug is printing an empty "src" tag (if that's what we're
 doing) in lieu of nothing at all.
 >
 > Additionally, perhaps [23378] also needs to check `|| $pagenow === 'wp-
 login.php' && current_filter() !== 'login_enqueue_scripts'`.

 Good point with the grouping, I've never thought of that.

 The situation is this: I've written a plugin that needs jQuery on the
 login page. Some themes reset (deregister and register with empty $src)
 jquery in the init-hook and register their own jquery in
 ''wp_enqueue_scripts''. This leaves ''login_enqueue_scripts'' with an
 empty jquery.
 Not printing an empty "src" tag won't help.

 I'd rather not see all plugins that use ''login_enqueue_scripts''
 deregister and register their own jquery just for the login page.

 Adding your suggested check to [23378] should not help since the
 deregister/register empty is done in the init-hook?
 Or am I reading it wrong?

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


More information about the wp-trac mailing list