From a2cb5307c81f356f49b2da94d2c18fa16e9a2a0b Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 29 Nov 2010 16:16:29 +0000 Subject: [PATCH] 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 --- wp-includes/admin-bar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 1236d16e97..10b4316ce3 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -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) ) );