WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#16586 closed defect (bug) (fixed)

Don't fire the wp_enqueue_scripts hook on wp-login.php

Reported by: nacin Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords:
Focuses: Cc:

Description (last modified by nacin)

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.

Attachments (1)

16586.diff (920 bytes) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (4)

@nacin5 years ago

comment:1 @nacin5 years ago

  • Description modified (diff)

Correcting the admin_enqueue_scripts hook name in the description.

comment:2 @markjaquith5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17466]) Do not attach wp_enqueue_scripts to login_head. New login_enqueue_scripts hook. props nacin. fixes #16586 for 3.1

comment:3 @nacin5 years ago

[17465] for trunk.

Note: See TracTickets for help on using tickets.