wp_nav_menu_setup() WordPress Function
The wp_nav_menu_setup() function is used to setup the default values for a custom menu in Wordpress. This function takes two arguments: the menu ID and the menu name. The menu ID is used to identify the menu in the database. The menu name is used to display the menu in the Wordpress admin interface.
wp_nav_menu_setup() #
Register nav menu meta boxes and advanced menu items.
Source
File: wp-admin/includes/nav-menu.php
function wp_nav_menu_setup() { // Register meta boxes. wp_nav_menu_post_type_meta_boxes(); add_meta_box( 'add-custom-links', __( 'Custom Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); wp_nav_menu_taxonomy_meta_boxes(); // Register advanced menu items (columns). add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); // If first time editing, disable advanced items by default. if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { $user = wp_get_current_user(); update_user_meta( $user->ID, 'managenav-menuscolumnshidden', array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', 4 => 'title-attribute', ) ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |