function wp_nav_menu_setup() {}

Register nav menu metaboxes and advanced menu items

Source code

function wp_nav_menu_setup() {

	// Register meta boxes

	if ( wp_get_nav_menus() )

		add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );

	add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );



	// 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_option($user->ID, 'managenav-menuscolumnshidden',

			array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', ),





No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: