wp_admin_bar_appearance_menu

Definition:
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {}

Add appearance submenu items to the "Site Name" menu.

Parameters

  • $wp_admin_bar

Source code

function wp_admin_bar_appearance_menu( $wp_admin_bar ) {

	$wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) );



	if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )

		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), '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') ) );



	if ( current_theme_supports( 'custom-background' ) )

		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );



	if ( current_theme_supports( 'custom-header' ) )

		$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );

}

10577

About these ads

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 179 other followers

%d bloggers like this: