[wp-trac] [WordPress Trac] #16586: Don't fire the wp_enqueue_scripts hook on wp-login.php
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 18 04:11:23 UTC 2011
#16586: Don't fire the wp_enqueue_scripts hook on wp-login.php
--------------------------+------------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.1
Component: Template | Version: 3.1
Severity: normal | Resolution:
Keywords: |
--------------------------+------------------
Old description:
> admin_print_scripts and wp_enqueue_scripts actions are ideally where
> wp_enqueue_script() calls should be attached to -- one for the admin, and
> one for the theme.
>
> [16000] attached wp_enqueue_scripts() to login_head, which is a wrapper
> function to fire the wp_enqueue_scripts action. This means that a theme
> attaching a script to the frontend via wp_enqueue_scripts -- even if
> wrapped in an unnecessary is_admin() check -- will get their JS printed
> on the login form. This has the potential to throw JS errors, which is
> what happens in P2 for example.
>
> The fix is to come up with a new action name.
New description:
admin_enqueue_scripts and wp_enqueue_scripts actions are ideally where
wp_enqueue_script() calls should be attached to -- one for the admin, and
one for the theme.
[16000] attached wp_enqueue_scripts() to login_head, which is a wrapper
function to fire the wp_enqueue_scripts action. This means that a theme
attaching a script to the frontend via wp_enqueue_scripts -- even if
wrapped in an unnecessary is_admin() check -- will get their JS printed on
the login form. This has the potential to throw JS errors, which is what
happens in P2 for example.
The fix is to come up with a new action name.
--
Comment (by nacin):
Correcting the admin_enqueue_scripts hook name in the description.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16586#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list