Add Appearance menu to admin bar. see #14772
git-svn-id: http://svn.automattic.com/wordpress/trunk@16078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
94a67ef5ff
commit
3ea2439dee
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue