Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20989 closed defect (bug) (invalid)

wp_enqueue_style in wp-login.php shows css load string in login_footer() not in head

Reported by: sgr33n's profile sgr33n Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:



If you enqueue a style, even if this style is loaded in the head of every page, on wp-login.php is loaded in login_footer().

This issue does not occur on wp_enqueue_script.

Change History (6)

#1 @SergeyBiryukov
12 years ago

wp_print_styles() needs to be added in this case, since it's not called automatically for login_head. Related discussion: ticket:17916:12.

#2 @sgr33n
12 years ago

Thanks for the answer :)
The problem for me is the opposite, I added a CSS to my plugin, the call is inside:

	if ( !is_admin() ) {

And I can see that on wp-login.php (where I don't need the CSS) the call executes on login_footer()

#3 @SergeyBiryukov
12 years ago

Yes, wp-login.php is not considered a part of the admin.

You could check $_SERVER['PHP_SELF'] or the $pagenow global, like is_admin_bar_showing() does:

global $pagenow;
if ( !is_admin() && 'wp-login.php' != $pagenow ) {

#4 @sgr33n
12 years ago

Perfect! Thanks :)

#5 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

#6 @husobj
12 years ago

  • Cc ben@… added
Note: See TracTickets for help on using tickets.