Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15592 closed defect (bug) (fixed)

Admin Bar Problem

Reported by: louyx Owned by: ocean90
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords:
Focuses: Cc:


Well, this happened after the update to the revision [16600]... the admin bar is now all over the content!

Attachments (3)

screenshot1.png (10.0 KB) - added by louyx 3 years ago.
2cztueu.jpg (90.2 KB) - added by pszeinert 3 years ago.
Side by side comparison of wpadminbar
15592.patch (1.5 KB) - added by ocean90 3 years ago.

Download all attachments as: .zip

Change History (16)

louyx3 years ago


comment:1 ryan3 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:2 ocean903 years ago

  • Keywords reporter-feedback added; admin bar css style removed

Does it works when you add define( 'SCRIPT_DEBUG', true ); to your wp-config.php file?
Must be a cache problem because ryan forget to update script-loader.php. :-)

comment:3 follow-up: ramoonus3 years ago

what browser are you using?

comment:4 in reply to: ↑ 3 pszeinert3 years ago

Replying to ramoonus:

what browser are you using?

I noticed some overlap in my custom theme too. I checked to see if the issue appeared on the default configuration of TwentyTen and verified the overlap in Chrome, FF and IE.

* WordPress 3.1 Beta; Chrome; TwentyTen no modifications *

The overlap should be expected since the admin bar is the last to load and #wpadminbar uses { position: fixed; width:100%; top: 0; } to position it. Nothing in the code compensates for the bar.

This is not so much an unintended consequence as an issue that has not yet been accounted for.

Possible solutions:
--Use JavaScript to collapse the bar to the right, left, or up.
--Call the wpadminbar sooner.
--Place the bar as fixed to the bottom, though this would likely suffer from the same issues as before.

pszeinert3 years ago

Side by side comparison of wpadminbar

comment:5 nacin3 years ago

  • Keywords reporter-feedback removed
  • Severity changed from normal to critical

comment:6 filosofo3 years ago

I can look into this if ocean90 isn't already.

comment:7 ocean903 years ago

  • Owner set to ocean90
  • Severity changed from critical to normal
  • Status changed from new to reviewing

I can't see a bug here really. In Backend it should work because wp-admin.css is now up2date too.
As mentioned on the original ticket #15507, themes should/must use body_class() where we had added the class "admin-bar" see [16432]. I'm not a fan of the idea to add hundreds of themes to core, only to position the admin bar nicely in there theme, like we did it before, see [16600].
So my idea:

  • add the CSS stuff to style.css from 2010 to show how it works
  • (re-)add a filter/action but only for the frontend and with the padding-top: 28px stuff

comment:8 follow-up: pszeinert3 years ago

.admin-bar shows up in my body class, and adding { padding-top:28px; } does the trick, but .admin-bar is not located in any of the files I have (WordPress 3.1-beta1-16590).

comment:9 ryan3 years ago

I think registering a default callback that can be changed by the theme will work, much like we do with _custom_background_cb().

By default, register _admin_bar_bump_cb() against wp_head. The theme can call add_theme_support('admin-bar', 'custom_callback) which will replace the default callback with a custom callback.

comment:10 in reply to: ↑ 8 ; follow-up: pszeinert3 years ago

Replying to pszeinert:

.admin-bar shows up in my body class, and adding { padding-top:28px; } does the trick, but .admin-bar is not located in any of the files I have (WordPress 3.1-beta1-16590).

Disregard my previous statement. The most recent files are on my server as I said, but I was searching files on an older 3.0.1 local dev install. After updating my local files, body.admin-bar exists in wp-admin.css (which most already knew). Sorry for the confusion.

Still can't see why it would not display properly.

comment:11 in reply to: ↑ 10 pszeinert3 years ago

Replying to pszeinert:

Still can't see why it would not display properly.

Actually, I can. On the admin side, load-styles.php runs and includes the body.admin-bar{padding-top:28px;}. On the site side, while still logged in, there is no call to include the styles in wp-admin.css.

I thought it might be the custom theme I am using, but even twentyten fails to add the body.admin-bar style.

comment:12 ocean903 years ago

  • Status changed from reviewing to accepted

pszeinert: The padding-top is only for the admin side not for "theme side". Working now on ryans idea.

ocean903 years ago

comment:13 ryan3 years ago

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

(In [16636]) Add bump down for menu bar. Allow themes to add a custom bump callback. Props ocean90. fixes #15592

Note: See TracTickets for help on using tickets.