WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15856 closed defect (bug) (fixed)

show_admin_bar(false) doesn't work

Reported by: nacin Owned by: westi
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-patch
Focuses: Cc:

Description (last modified by nacin)

show_admin_bar(false) doesn't work. See the first comment for more.


My initial report:
Admin bar shouldn't show in theme preview iframe

It takes up space and looks weird. People are trying to preview a theme, and the admin bar is an unnecessary constant.

This should also be fixed.

Change History (8)

comment:1 nacin3 years ago

  • Description modified (diff)
  • Summary changed from Admin bar shouldn't show in theme preview iframe to show_admin_bar(false) doesn't work
  • Type changed from enhancement to defect (bug)

show_admin_bar() has apparently been crippled.

You should be able to call show_admin_bar( false ) before the admin bar is initiated, and it should kill the admin bar.

We should either eliminate this function, or fix it. I vote to fix it, otherwise putting this simple logic into preview_theme() doesn't work:

if ( isset( $_GET['TB_iframe'] ) )
    show_admin_bar( false );

And the call to show_admin_bar() in iframe_header() is useless.

comment:2 nacin3 years ago

This was crippled: [15938]

comment:3 westi3 years ago

  • Owner set to westi
  • Status changed from new to accepted

comment:4 westi3 years ago

This isn't show_admin_bar()'s fault.

Thickbox strips TB_iframe from the request

comment:5 westi3 years ago

(In [17018]) Make note that this is a preview_iframe. See #15856

comment:6 westi3 years ago

(In [17020]) If we are previewing don't show the admin bar. See #15856

comment:7 westi3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [17021]) Ensure show_admin_bar( false ) works after init. Fixes #15856.

comment:8 westi3 years ago

Note calling show_admin_bar( true ) late on is not going to evar evar evar be supported.

If you really want it ask early.

Note: See TracTickets for help on using tickets.