WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#28569 reviewing enhancement

Calling show_admin_bar( false ) should dehook toolbar entirely

Reported by: danielbachhuber Owned by: chriscct7
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: good-first-bug has-patch
Focuses: Cc:

Description

Because I'm only hiding the toolbar in certain contexts, I'm calling show_admin_bar( false ) right before get_header(). #16249 was closed suggesting the function should only be called on init. #21746 suggests calling after plugins_loaded However, I think calling it after the query is set and the template is picked is a valid use case.

As such, I'd propose calling show_admin_bar( false ) should run remove_action('wp_head', '_admin_bar_bump_cb'); and similar setup callbacks.

Attachments (1)

28569.patch (428 bytes) - added by paulschreiber 4 years ago.

Download all attachments as: .zip

Change History (5)

#1 @paulschreiber
4 years ago

What other callbacks count as "and similar setup callbacks"?

@paulschreiber
4 years ago

#2 @helen
4 years ago

  • Keywords has-patch added; needs-patch removed

#3 @DrewAPicture
4 years ago

  • Owner set to paulschreiber
  • Status changed from new to assigned

#4 @chriscct7
3 years ago

  • Owner changed from paulschreiber to chriscct7
  • Status changed from assigned to reviewing
Note: See TracTickets for help on using tickets.