From 9d8b8ace88760f93921c921b46403b4593541468 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@16610 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 1236d16e9..10b4316ce 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) ) );