WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#48831 new enhancement

WP Admin Bar doesn't display on wp-login.php page

Reported by: henry.wright Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: has-patch
Focuses: Cc:

Description

I like to display the WP Admin Bar on all pages even if a user isn't authenticated because we get the WordPress logo and menu and a search button. To always show the WP Admin Bar we can do this:

add_filter( 'show_admin_bar', '__return_true' );

This will display it everywhere except wp-login.php. I think it _should_ display on this page if we return true in show_admin_bar()

Attachments (2)

48831.diff (1.5 KB) - added by donmhico 3 months ago.
48831.2.diff (2.2 KB) - added by donmhico 3 months ago.
With CSS fix.

Download all attachments as: .zip

Change History (10)

#1 @henry.wright
3 months ago

I think it _should_ display on this page if we return true in show_admin_bar()

I can't edit the ticket description but I should have said:

I think it _should_ display on this page if we return true in the filter.

#2 @henry.wright
3 months ago

  • Component changed from General to Toolbar

#3 @henry.wright
3 months ago

This is because wp-login.php uses a different set of hooks. login_header and login_footer are used instead of wp_head and wp_footer

@donmhico
3 months ago

#4 @donmhico
3 months ago

  • Type changed from defect (bug) to enhancement

@donmhico
3 months ago

With CSS fix.

#5 @donmhico
3 months ago

Hello @henrywright,

I attached a patch, https://core.trac.wordpress.org/attachment/ticket/48831/48831.2.diff, that should address this ticket.

P.S. - I changed this ticket from bug to enhancement as I feel that this is more of an enhancement.

#6 @donmhico
3 months ago

  • Keywords has-patch added

#7 @SergeyBiryukov
3 months ago

I like to display the WP Admin Bar on all pages even if a user isn't authenticated because we get the WordPress logo and menu and a search button.

Just noting there's a Logged Out Admin Bar plugin used on WordPress.org for that purpose, though it doesn't display the toolbar on the login page either.

#8 @henry.wright
3 months ago

@donmhico I think you are right to set this to an enhancement. It isn't really a bug

Thanks @SergeyBiryukov

Note: See TracTickets for help on using tickets.