WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 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 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:

Description

Hi,

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)

comment:1 @SergeyBiryukov3 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.

comment:2 @sgr33n3 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()

comment:3 @SergeyBiryukov3 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:
http://core.trac.wordpress.org/browser/tags/3.4/wp-includes/admin-bar.php#L734

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

comment:4 @sgr33n3 years ago

Perfect! Thanks :)

comment:5 @SergeyBiryukov3 years ago

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

comment:6 @husobj3 years ago

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