wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



_wp_menus_changed › WordPress Function

Depuis4.9.0
Dépréciéen/a
› _wp_menus_changed ( Pas de paramètres )
Accès:
  • private
Défini(e) dans:
Codex:

Handles menu config after theme change.



Source

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' );
}