wp_nav_menu_setup()
Registers meta boxes and adds a section "Show advanced menu properties" in screen options.
This function is called on the page for creating and editing custom menus in WordPress.
The function is used by the engine and is generally not intended for use elsewhere.
Order of operation:
- Called on the page /wp-admin/nav-menus.php
- Calls wp_nav_menu_post_type_meta_boxes() to register meta boxes for each post type where posts can be selected as menu items.
- Calls add_meta_box( 'add-custom-links', ... ) to register a meta box that allows adding custom links to the menu.
- Calls wp_nav_menu_taxonomy_meta_boxes() for each taxonomy where terms can be selected as menu items.
- Calls add_filter( 'manage_nav-menus_columns', ...), which adds the option to display advanced properties of menu items (title attribute, CSS classes, etc.) in screen options.
- Checks for the existence of the meta-field managenav-menuscolumnshidden for the user and, if it does not exist, creates it with default display parameters for advanced menu properties. This is needed for cases when the user visits the menu creation page for the first time.
No Hooks.
Returns
null. Nothing (null).
Usage
wp_nav_menu_setup();
Examples
#1 Used in the WP core
See the file /wp-admin/nav-menus.php for an example of how to use it.
Changelog
| Since 3.0.0 | Introduced. |