Add Appearance menu to admin bar. see #14772

git-svn-id: https://develop.svn.wordpress.org/trunk@16078 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-10-29 15:26:36 +00:00
parent 81b8a20429
commit 3c374b177c
2 changed files with 20 additions and 1 deletions

View File

@ -227,6 +227,24 @@ function wp_admin_bar_comments_menu() {
$wp_admin_bar->add_menu( array( 'id' => 'comments', 'title' => sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'href' => admin_url('comments.php') ) );
}
function wp_admin_bar_appearance_menu() {
global $wp_admin_bar;
if ( !current_user_can('switch themes') )
return;
$wp_admin_bar->add_menu( array( 'id' => 'appearance', 'title' => __('Appearance'), 'href' => admin_url('themes.php') ) );
if ( !current_user_can('edit_theme_options') )
return;
if ( current_theme_supports( 'widgets' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
}
/**
* Style and scripts for the admin bar.
*

View File

@ -181,7 +181,8 @@ class WP_Admin_Bar {
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_edit_menu', 40 );
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_new_content_menu', 50 );
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_comments_menu', 60 );
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_shortlink_menu', 70 );
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_appearance_menu', 70 );
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_shortlink_menu', 80 );
if ( is_multisite() && is_super_admin() && function_exists('wp_admin_bar_superadmin_settings_menu') )
add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_superadmin_settings_menu', 1000 );