/**
* Handles menu config after theme change.
*
* @access private
* @since 4.9.0
*/
function _wp_menus_changed() { $old_nav_menu_locations =
get_option( 'theme_switch_menu_locations', array
() );
$new_nav_menu_locations =
get_nav_menu_locations();
$mapped_nav_menu_locations =
wp_map_nav_menu_locations( $new_nav_menu_locations,
$old_nav_menu_locations );
set_theme_mod( 'nav_menu_locations',
$mapped_nav_menu_locations );
delete_option( 'theme_switch_menu_locations'
);
}/**
* Maps nav menu locations according to assignments in previously active theme.
*
* @since 4.9.0
*
* @param array $new_nav_menu_locations New nav menu locations assignments.
* @param array $old_nav_menu_locations Old nav menu locations assignments.
* @return array Nav menus mapped to new nav menu locations.
*/