#34418 closed defect (bug) (fixed)
The Toolbar isn't displayed on wp-signup.php when you're logged-in.
Reported by: | DrewAPicture | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Login and Registration | Keywords: | has-screenshots has-patch commit |
Focuses: | Cc: |
Description
The Toolbar doesn't get initialized and therefore doesn't get rendered on wp-signup.php when you're logged in.
This was actually a pretty cool bug to track down.
Turns out, the bug was introduced three years ago in [23512] when the _wp_admin_bar_init()
callback was switched from the init
hook to template_redirect
and admin_init
, respectively, to allow access to conditional tags for the show_admin_bar
hook.
The template_redirect
hook isn't fired on wp-signup.php because WP_USE_THEMES
isn't defined.
Solution: We can't force template_redirect
to fire on wp-signup.php because it'll actually try to load a template instead, so the best option is to hook to signup_header
.
Attachments (2)
Change History (10)
#3
@
8 years ago
As I see in the screenshot above, the admin bar is overlapping the page. To make the admin bar displayed correctly, the sign up page needs to have the top margin added by _admin_bar_bump_cb()
as other pages.
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/admin-bar.php#L864
#5
@
8 years ago
- Keywords has-patch commit added; needs-patch removed
- Owner set to DrewAPicture
- Status changed from new to accepted
34418.2.diff instead uses the before_signup_header
hook. This enables the _wp_admin_bar_init()
function to run before wp_head
fires like it does elsewhere on the front-end on template_redirect
or in the admin on admin_init
. This has the effect that _admin_bar_bump_cb()
can then fire on wp_head
in the expected order.
I tested this patch and it works as promised.
Here are some screenshots visiting
wp-signup.php
as a logged in user:Before patch:
After patch: