Default Add New menu link to first post type in list. Avoids empty href issues. see #15308

git-svn-id: https://develop.svn.wordpress.org/trunk@16610 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-11-29 16:16:29 +00:00
parent a9042cad2d
commit a2cb5307c8

View File

@ -205,7 +205,7 @@ function wp_admin_bar_new_content_menu() {
if ( empty( $actions ) )
return;
$wp_admin_bar->add_menu( array( 'id' => 'new-content', 'title' => _x( 'Add New', 'admin bar menu group label' ), 'href' => '', ) );
$wp_admin_bar->add_menu( array( 'id' => 'new-content', 'title' => _x( 'Add New', 'admin bar menu group label' ), 'href' => admin_url( array_shift( array_keys( $actions ) ) ), ) );
foreach ( $actions as $link => $action ) {
$wp_admin_bar->add_menu( array( 'parent' => 'new-content', 'id' => $action[2], 'title' => $action[0], 'href' => admin_url($link) ) );