$item_ids =
wp_save_nav_menu_items( 0,
$menu_items_data );
if ( is_wp_error( $item_ids ) ) { wp_die( 0
);
} $menu_items = array
();
foreach ( (array) $item_ids as $menu_item_id ) { $menu_obj =
get_post( $menu_item_id );
if ( !
empty( $menu_obj->ID
) ) { $menu_obj =
wp_setup_nav_menu_item( $menu_obj );
$menu_obj->title =
empty( $menu_obj->title
) ?
__( 'Menu Item'
) :
$menu_obj->title;
$menu_obj->label =
$menu_obj->title; // Don't show "(pending)" in ajax-added items.
$menu_items[] =
$menu_obj;
} } /** This filter is documented in wp-admin/includes/nav-menu.php */
$walker_class_name =
apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit',
$_POST['menu'
] );
if ( !
class_exists( $walker_class_name ) ) { wp_die( 0
);
}