Tabbed Meta Box in WordPress

I’ve updated the code to use the core WordPress UI. You can find it here.

I recently worked on a project that required me to add a custom meta box with tabs. In the spirit of GPL, I would like to share my code. The sample plugin checks the admin theme used by the user and enqueues the appropriate stylesheet to match the admin look and feel. The meta box looks and works fine with JavaScript disabled.

Download: Tabbed Meta Box in WordPress

Blue Theme with JavaScript Enabled

Fresh Theme with JavaScript Enabled

Meta Box in the side with JavaScipt Enabled

JavaScript Disabled

Disable Admin Bar and Hide Preferences

Before you consider removing the admin bar, you should read this.

WordPress 3.1 was released earlier today and one of the key features is the admin bar, which allows you to get to your most-used dashboard pages with a single click. However, the admin bar is not for everyone and you can easily hide it by visiting your profile page.

You can also disable the admin bar for all users on your site by adding the following code to a plugin or the functions file of your theme:

add_filter( 'show_admin_bar', '__return_false' );

This will disable the admin bar for all users on your site but they will still see the admin bar preferences in their profile. You can hide the admin bar preferences using:

add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_prefs' );
function hide_admin_bar_prefs() { ?>
<style type="text/css">
	.show-admin-bar { display: none; }
</style>
<?php
}

Note: If you are using this code to only hide the preferences without disabling the admin bar, your users can still change the values by manually editing the hidden variables before the page is submitted.

WordPress 3.0.1 Release Candidate 1

WordPress 3.0.1 Release Candidate was just tagged and released. You can use Peter Westwood’s Beta Tester Plugin and use “Point Release Nightlies” to upgrade from WordPress 3.0 to the new release candidate.

WordPress 3.0.1 includes several bugfixes. Please consult the changelog on Trac for details on what has changed in this release.