Advertisements

wp_admin_bar_wp_menu

Definition:
function wp_admin_bar_wp_menu( $wp_admin_bar ) {}

Add the WordPress logo menu.

Parameters

  • $wp_admin_bar

Source code

function wp_admin_bar_wp_menu( $wp_admin_bar ) {

	$wp_admin_bar->add_menu( array(

		'id'    => 'wp-logo',

		'title' => '<span class="ab-icon"></span>',

		'href'  => admin_url( 'about.php' ),

		'meta'  => array(

			'title' => __('About WordPress'),

		),

	) );



	if ( is_user_logged_in() ) {

		// Add "About WordPress" link

		$wp_admin_bar->add_menu( array(

			'parent' => 'wp-logo',

			'id'     => 'about',

			'title'  => __('About WordPress'),

			'href'   => admin_url('about.php'),

		) );

	}



	// Add WordPress.org link

	$wp_admin_bar->add_menu( array(

		'parent'    => 'wp-logo-external',

		'id'        => 'wporg',

		'title'     => __('WordPress.org'),

		'href'      => __('http://wordpress.org'),

	) );



	// Add codex link

	$wp_admin_bar->add_menu( array(

		'parent'    => 'wp-logo-external',

		'id'        => 'documentation',

		'title'     => __('Documentation'),

		'href'      => __('http://codex.wordpress.org'),

	) );



	// Add forums link

	$wp_admin_bar->add_menu( array(

		'parent'    => 'wp-logo-external',

		'id'        => 'support-forums',

		'title'     => __('Support Forums'),

		'href'      => __('http://wordpress.org/support/'),

	) );



	// Add feedback link

	$wp_admin_bar->add_menu( array(

		'parent'    => 'wp-logo-external',

		'id'        => 'feedback',

		'title'     => __('Feedback'),

		'href'      => __('http://wordpress.org/support/forum/requests-and-feedback'),

	) );

}

17422

Advertisements

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

%d bloggers like this: