register_nav_menus()注册多个前台导航菜单

目录

描述

Registers multiple custom navigation menus in the new custom menu editor of WordPress 3.0. This allows for the creation of custom menus in the dashboard for use in your theme.

See register_nav_menu() for creating a single menu, and Navigation Menus for adding theme support.

register_nav_menus() 描述

用法

 <?php register_nav_menus$locations ); ?> 

register_nav_menus() 用法

参数

$locations

(array) (必填) An associative array of menu location slugs (key) and descriptions (according value).

默认值: None

register_nav_menus() 参数

返回值

None.

register_nav_menus() 返回值

示例

register_nav_menus() 示例

注意

  • This function automatically registers custom menu support for the theme, therefore you do not need to call add_theme_support( 'menus' );
  • Use wp_nav_menu() to display your custom menu.
  • In the Menus admin page, there is a Show advanced menu properties to allow "Link Target" "CSS Classes" "Link Relationship (XFN) Description"
  • Use get_registered_nav_menus to get back a list of the menus that have been registered in a theme.

register_nav_menus() 注意

历史

  • 添加于 版本: 3.0.0

register_nav_menus() 历史

源文件

register_nav_menus() 源文件

相关