7
Jul

Admin Menus Fixed WordPress Plugin For 3.2

   Posted by: Johnson B.E.

My first plugin has now gone through two major updates. With the release of WordPress 3.2, a plugin update was definitely necessary. The Admin Screen layout and menus have changed a bit, many things for the better, and Ozh updated his plugin for v3.2 compatibility. My turn. Going in, my concern was how to make these new changes and not have WordPress 3.1.x users end up with screwed up menu bars. No way to know until I dived into the code of the new Admin system to figure out what had changed.

This Darn Thing...

The User Menu on the right end of the Admin Header (the Howdy menu) gave me the most trouble, due to the now collapsible Standard Admin Menu that normally occupies the left side of the screen when Ozh' Admin Drop Down Menu is not activated. When expanded, the Standard Admin Menu horizontally compresses the Admin widgets but shifts the User Menu off-screen to the right. I fought with this for quite a while; right up until I finally stepped back and re-evaluated the entire situation from a User Centered Design perspective.

User Centered Design is something quite often overlooked. And it shouldn't be. Not many designers do it. Most have no idea what it is. Yet, it is the essential component of any successful design. When I donned the User Centered Design glasses, I realized that this pesky menu is in the wrong place. Yes, there are the Screen Options and Help buttons over there but one rarely uses them. All of the rest of the menus are on the left; extending toward left center. "What's that thing doing over there?" rang in my head. Let's see what's possible. One tweak to my code and problem solved. Now, everything is in one area; making workflow even more efficient.

If It's a Menu, It's Fixed

One of the nicest enhancements is that I made the new Standard Menu fixed-position in both expanded and collapsed modes. So, if you don't have Ozh' menu installed and activated, the Standard Admin Menu now stays put when you scroll. Cool.

While in there, I adjusted the positioning of the upper page elements, so as to more efficiently make use of the space available. The Page Title Header on the left is moved up, so that it overlaps vertically the Screen Options and Help buttons on the right; instead of dropping below them; creating a big empty space in the middle. They never get anywhere near each other. Why not compress the space?

Once I got everything set to handle all six possible combinations of what's activated and what's deactivated—what's on and what's off—what's expanded and what's collapsed and everything looked well placed, it's time to poke the compatibility dragon. Fearing the worst, that I was going to be spending at least as much time, if not more, making my plugin work on an earlier WP version, I sent the new code up to my 3.1.4 version install and reloaded the page. "What the...? The page looked fine running the new code on the 3.1 version. My initial concern was unfounded. A couple of positioning tweaks could have been made but they aren't so jarring, so as to require users to load an older version just for that. It looked great just the way it is and users running older versions get the benefit of the new positioning.

Backwards compatible is a Good Thing™

You should upgrade your WP to the current shipping version anyway, but many people wait or don't get around to it right away. While that is going on, the plugin notifies them that there is an updated version. They're covered.

Now, the plugin does this:
Ozh' Admin Drop Down Menu Activated
Admin Bar On, Admin Header On • All Fixed-Position
All Three Admin Menu Bars Stacked, Compressed and Fixed
Ozh' Admin Drop Down Menu Activated
Admin Bar Off, Admin Header On • All Fixed-Position
Admin Bar Off, Two Admin Menu Bars Stacked, Compressed and Fixed
Ozh' Admin Drop Down Menu Deactivated
Admin Bar On, Admin Header On
Standard WordPress Admin Menu Expanded • All Fixed-Position
Admin Bar On, Admin Header On, Standard WordPress Admin Menu Expanded - All Three Fixed
Ozh' Admin Drop Down Menu Deactivated
Admin Bar Off, Admin Header On
Standard WordPress Admin Menu Collapsed • All Fixed-Position
Admin Bar Off, Admin Header On, Standard WordPress Admin Menu Collapsed - Both Fixed

Solved another natty problem and made it more functional. Check it out. Let me know how it works for you and if there's anything I could improve upon.

Download the latest version at The WordPress.org Plugin Directory.

I hope you enjoy it. And, as always, Thanks to Ozh for encouraging me to jump in and write this.

Like it? Found a problem? Drop a comment on the The Plugin Enhanced post.

Copyright © 1976-2024 The Art & Engineering of B.E.Johnson