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

git-svn-id: https://develop.svn.wordpress.org/trunk@15008 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-27 22:22:09 +00:00
parent 7ed6bc6ccb
commit 29ccf1ec31
4 changed files with 88 additions and 33 deletions
+3 -8
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 );