New pending menu item behavior. props filosofo, see #13579.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2010-05-27 22:22:09 +00:00
parent da16117198
commit 15a1a43cd1
4 changed files with 88 additions and 33 deletions

View File

@@ -816,14 +816,9 @@ case 'add-menu-item' :
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
$menu_id = (int) $_POST['menu'];
if ( isset( $_POST['menu-item'] ) ) {
$item_ids = wp_save_nav_menu_items( $menu_id, $_POST['menu-item'] );
if ( is_wp_error( $item_ids ) )
die('-1');
} else {
$item_ids = array();
}
$item_ids = wp_save_nav_menu_items( 0, $_POST['menu-item'] );
if ( is_wp_error( $item_ids ) )
die('-1');
foreach ( (array) $item_ids as $menu_item_id ) {
$menu_obj = get_post( $menu_item_id );