function wp_save_nav_menu_items( $menu_id = 0,
$menu_data = array
() ) { $menu_id =
(int) $menu_id;
$items_saved = array
();
if ( 0 ===
$menu_id ||
is_nav_menu( $menu_id ) ) { // Loop through all the menu items' POST values.
foreach ( (array) $menu_data as $_possible_db_id =>
$_item_object_data ) { if ( // Checkbox is not checked.
empty( $_item_object_data['menu-item-object-id'
] ) && ( // And item type either isn't set.
!
isset( $_item_object_data['menu-item-type'
] ) ||
// Or URL is the default.
in_array( $_item_object_data['menu-item-url'
], array
( 'https://', 'http://', ''
), true
) ||