Opened 4 years ago
Last modified 2 years ago
#48831 new enhancement
WP Admin Bar doesn't display on wp-login.php page
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Toolbar | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
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 the filter
Attachments (3)
Change History (13)
#3
@
4 years 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
#5
@
4 years 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.
#7
@
4 years 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
@
4 years ago
@donmhico I think you are right to set this to an enhancement. It isn't really a bug
Thanks @SergeyBiryukov
#10
@
2 years ago
Latest iteration: 48831.3.diff
I moved the actions into wp-login.php so it checks whether the filter returns true (not every case of showing toolbar). The toolbar also does not fit in an interim login.
For the CSS, I prefer resetting form
element styles along with the links, and the search input min-height matches the height. The html
element includes an admin-bar
class so the full height layout can subtract the toolbar height from 100% (using the new custom property).
I can't edit the ticket description but I should have said: