WordPress开发者和主题制作者的搜索引擎



_wp_menus_changed ›

Since4.9.0
已弃用n/a
_wp_menus_changed ( 没有参数 )
访问:
  • private
定义在:
文档:

Handle menu config after theme change.



源码

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