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



register_nav_menus ›

Since3.0.0
已弃用n/a
register_nav_menus ( $locations = array() )
参数:
  • (array) $locations Associative array of menu location identifiers (like a slug) and descriptive text.
    Required: No
    默认: array()
定义在:
文档:

Registers navigation menu locations for a theme.



源码

function register_nav_menus( $locations = array() ) {
	global $_wp_registered_nav_menus;

	add_theme_support( 'menus' );

	$_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );
}