X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..53a5df18dd17a11c18781e78349feb3e139096b4:/wp-admin/nav-menus.php diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 5b4bd44e..7306778a 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -10,7 +10,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( 'admin.php' ); +require_once( dirname( __FILE__ ) . '/admin.php' ); // Load all the nav menu interface functions require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' ); @@ -22,22 +22,10 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' if ( ! current_user_can('edit_theme_options') ) wp_die( __( 'Cheatin’ uh?' ) ); -// Nav Menu CSS -wp_admin_css( 'nav-menu' ); - -// jQuery -wp_enqueue_script( 'jquery' ); -wp_enqueue_script( 'jquery-ui-draggable' ); -wp_enqueue_script( 'jquery-ui-droppable' ); -wp_enqueue_script( 'jquery-ui-sortable' ); - -// Nav Menu functions wp_enqueue_script( 'nav-menu' ); -// Metaboxes -wp_enqueue_script( 'common' ); -wp_enqueue_script( 'wp-lists' ); -wp_enqueue_script( 'postbox' ); +if ( wp_is_mobile() ) + wp_enqueue_script( 'jquery-touch-punch' ); // Container for any messages displayed to the user $messages = array(); @@ -48,6 +36,11 @@ $nav_menu_selected_title = ''; // The menu id of the current menu being edited $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0; +// Get existing menu locations assignments +$locations = get_registered_nav_menus(); +$menu_locations = get_nav_menu_locations(); +$num_locations = count( array_keys( $locations ) ); + // Allowed actions: add, update, delete $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit'; @@ -70,7 +63,7 @@ switch ( $action ) { $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); - // setup the data we need in one pass through the array of menu items + // set up the data we need in one pass through the array of menu items $dbids_to_orders = array(); $orders_to_dbids = array(); foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) { @@ -121,7 +114,6 @@ switch ( $action ) { wp_update_post($next_item_data); } - // the item is last but still has a parent, so bubble up } elseif ( ! empty( $menu_item_data['menu_item_parent'] ) && @@ -144,7 +136,7 @@ switch ( $action ) { $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); - // setup the data we need in one pass through the array of menu items + // set up the data we need in one pass through the array of menu items $dbids_to_orders = array(); $orders_to_dbids = array(); foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) { @@ -156,7 +148,6 @@ switch ( $action ) { } } - // if this menu item is not first if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) { @@ -232,53 +223,63 @@ switch ( $action ) { check_admin_referer( 'delete-menu_item_' . $menu_item_id ); - if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) $messages[] = '

' . __('The menu item has been successfully deleted.') . '

'; break; + case 'delete': check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id ); - if ( is_nav_menu( $nav_menu_selected_id ) ) { - $deleted_nav_menu = wp_get_nav_menu_object( $nav_menu_selected_id ); - $delete_nav_menu = wp_delete_nav_menu( $nav_menu_selected_id ); - - if ( is_wp_error($delete_nav_menu) ) { - $messages[] = '

' . $delete_nav_menu->get_error_message() . '

'; - } else { - // Remove this menu from any locations. - $locations = get_theme_mod( 'nav_menu_locations' ); - foreach ( (array) $locations as $location => $menu_id ) { - if ( $menu_id == $nav_menu_selected_id ) - $locations[ $location ] = 0; - } - set_theme_mod( 'nav_menu_locations', $locations ); - $messages[] = '

' . __('The menu has been successfully deleted.') . '

'; - // Select the next available menu - $nav_menu_selected_id = 0; - $_nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); - foreach( $_nav_menus as $index => $_nav_menu ) { - if ( strcmp( $_nav_menu->name, $deleted_nav_menu->name ) >= 0 - || $index == count( $_nav_menus ) - 1 ) { - $nav_menu_selected_id = $_nav_menu->term_id; - break; - } - } - } - unset( $delete_nav_menu, $deleted_nav_menu, $_nav_menus ); + $deletion = wp_delete_nav_menu( $nav_menu_selected_id ); } else { // Reset the selected menu $nav_menu_selected_id = 0; unset( $_REQUEST['menu'] ); } + + if ( ! isset( $deletion ) ) + break; + + if ( is_wp_error( $deletion ) ) + $messages[] = '

' . $deletion->get_error_message() . '

'; + else + $messages[] = '

' . __( 'The menu has been successfully deleted.' ) . '

'; + break; + + case 'delete_menus': + check_admin_referer( 'nav_menus_bulk_actions' ); + foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) { + if ( ! is_nav_menu( $menu_id_to_delete ) ) + continue; + + $deletion = wp_delete_nav_menu( $menu_id_to_delete ); + if ( is_wp_error( $deletion ) ) { + $messages[] = '

' . $deletion->get_error_message() . '

'; + $deletion_error = true; + } + } + + if ( empty( $deletion_error ) ) + $messages[] = '

' . __( 'Selected menus have been successfully deleted.' ) . '

'; break; case 'update': check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); - // Update menu theme locations - if ( isset( $_POST['menu-locations'] ) ) - set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) ); + // Remove menu locations that have been unchecked + foreach ( $locations as $location => $description ) { + if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ) + unset( $menu_locations[ $location ] ); + } + + // Merge new and existing menu locations if any new ones are set + if ( isset( $_POST['menu-locations'] ) ) { + $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); + $menu_locations = array_merge( $menu_locations, $new_menu_locations ); + } + + // Set menu locations + set_theme_mod( 'nav_menu_locations', $menu_locations ); // Add Menu if ( 0 == $nav_menu_selected_id ) { @@ -290,26 +291,45 @@ switch ( $action ) { if ( is_wp_error( $_nav_menu_selected_id ) ) { $messages[] = '

' . $_nav_menu_selected_id->get_error_message() . '

'; } else { - if ( ( $_menu_locations = get_registered_nav_menus() ) && 1 == count( wp_get_nav_menus() ) ) - set_theme_mod( 'nav_menu_locations', array( key( $_menu_locations ) => $_nav_menu_selected_id ) ); - unset( $_menu_locations ); $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); $nav_menu_selected_id = $_nav_menu_selected_id; $nav_menu_selected_title = $_menu_object->name; - $messages[] = '

' . sprintf( __('The %s menu has been successfully created.'), $nav_menu_selected_title ) . '

'; + if ( isset( $_REQUEST['menu-item'] ) ) + wp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) ); + if ( isset( $_REQUEST['zero-menu-state'] ) ) { + // If there are menu items, add them + wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ); + // Auto-save nav_menu_locations + $locations = get_nav_menu_locations(); + foreach ( $locations as $location => $menu_id ) { + $locations[ $location ] = $nav_menu_selected_id; + break; // There should only be 1 + } + set_theme_mod( 'nav_menu_locations', $locations ); + } + if ( isset( $_REQUEST['use-location'] ) ) { + $locations = get_registered_nav_menus(); + $menu_locations = get_nav_menu_locations(); + if ( isset( $locations[ $_REQUEST['use-location'] ] ) ) + $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id; + set_theme_mod( 'nav_menu_locations', $menu_locations ); + } + // $messages[] = '

' . sprintf( __( '%s has been created.' ), $nav_menu_selected_title ) . '

'; + wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); + exit(); } } else { - $messages[] = '

' . __('Please enter a valid menu name.') . '

'; + $messages[] = '

' . __( 'Please enter a valid menu name.' ) . '

'; } - // update existing menu + // Update existing menu } else { $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ); $menu_title = trim( esc_html( $_POST['menu-name'] ) ); if ( ! $menu_title ) { - $messages[] = '

' . __('Please enter a valid menu name.') . '

'; + $messages[] = '

' . __( 'Please enter a valid menu name.' ) . '

'; $menu_title = $_menu_object->name; } @@ -325,89 +345,87 @@ switch ( $action ) { } // Update menu items - if ( ! is_wp_error( $_menu_object ) ) { - $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish') ); - $menu_items = array(); - // Index menu items by db ID - foreach( $unsorted_menu_items as $_item ) - $menu_items[$_item->db_id] = $_item; - - $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); - wp_defer_term_counting(true); - // Loop through all the menu items' POST variables - if ( ! empty( $_POST['menu-item-db-id'] ) ) { - foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) { - - // Menu item title can't be blank - if ( empty( $_POST['menu-item-title'][$_key] ) ) - continue; - - $args = array(); - foreach ( $post_fields as $field ) - $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : ''; - - $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); - - if ( is_wp_error( $menu_item_db_id ) ) - $messages[] = '

' . $menu_item_db_id->get_error_message() . '

'; - elseif ( isset( $menu_items[$menu_item_db_id] ) ) - unset( $menu_items[$menu_item_db_id] ); - } - } - - // Remove menu items from the menu that weren't in $_POST - if ( ! empty( $menu_items ) ) { - foreach ( array_keys( $menu_items ) as $menu_item_id ) { - if ( is_nav_menu_item( $menu_item_id ) ) { - wp_delete_post( $menu_item_id ); - } - } - } + $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) ); + } + } + break; + case 'locations': + if ( ! $num_locations ) { + wp_redirect( admin_url( 'nav-menus.php' ) ); + exit(); + } - // Store 'auto-add' pages. - $auto_add = ! empty( $_POST['auto-add-pages'] ); - $nav_menu_option = (array) get_option( 'nav_menu_options' ); - if ( ! isset( $nav_menu_option['auto_add'] ) ) - $nav_menu_option['auto_add'] = array(); - if ( $auto_add ) { - if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) - $nav_menu_option['auto_add'][] = $nav_menu_selected_id; - } else { - if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) ) - unset( $nav_menu_option['auto_add'][$key] ); - } - // Remove nonexistent/deleted menus - $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) ); - update_option( 'nav_menu_options', $nav_menu_option ); + add_filter( 'screen_options_show_screen', '__return_false' ); - wp_defer_term_counting(false); + if ( isset( $_POST['menu-locations'] ) ) { + check_admin_referer( 'save-menu-locations' ); - do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); + $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); + $menu_locations = array_merge( $menu_locations, $new_menu_locations ); + // Set menu locations + set_theme_mod( 'nav_menu_locations', $menu_locations ); - $messages[] = '

' . sprintf( __('The %s menu has been updated.'), $nav_menu_selected_title ) . '

'; - unset( $menu_items, $unsorted_menu_items ); - } + $messages[] = '

' . __( 'Menu locations updated.' ) . '

'; } break; } // Get all nav menus $nav_menus = wp_get_nav_menus( array('orderby' => 'name') ); +$menu_count = count( $nav_menus ); + +// Are we on the add new screen? +$add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false; + +$locations_screen = ( isset( $_GET['action'] ) && 'locations' == $_GET['action'] ) ? true : false; + +// If we have one theme location, and zero menus, we take them right into editing their first menu +$page_count = wp_count_posts( 'page' ); +$one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false; + +$nav_menus_l10n = array( + 'oneThemeLocationNoMenus' => $one_theme_location_no_menus, + 'moveUp' => __( 'Move up one' ), + 'moveDown' => __( 'Move down one' ), + 'moveToTop' => __( 'Move to the top' ), + /* translators: %s: previous item name */ + 'moveUnder' => __( 'Move under %s' ), + /* translators: %s: previous item name */ + 'moveOutFrom' => __( 'Move out from under %s' ), + /* translators: %s: previous item name */ + 'under' => __( 'Under %s' ), + /* translators: %s: previous item name */ + 'outFrom' => __( 'Out from under %s' ), + /* translators: 1: item name, 2: item position, 3: total number of items */ + 'menuFocus' => __( '%1$s. Menu item %2$d of %3$d.' ), + /* translators: 1: item name, 2: item position, 3: parent item name */ + 'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ), +); +wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); + +// Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations +if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) + wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); // Get recently edited nav menu -$recently_edited = (int) get_user_option( 'nav_menu_recently_edited' ); - -// If there was no recently edited menu, and $nav_menu_selected_id is a nav menu, update recently edited menu. -if ( !$recently_edited && is_nav_menu( $nav_menu_selected_id ) ) { +$recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) ); +if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) $recently_edited = $nav_menu_selected_id; -// Else if $nav_menu_selected_id is not a menu and not requesting that we create a new menu, but $recently_edited is a menu, grab that one. -} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && is_nav_menu( $recently_edited ) ) { +// Use $recently_edited if none are selected +if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) $nav_menu_selected_id = $recently_edited; -// Else try to grab the first menu from the menus list -} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && ! empty($nav_menus) ) { +// On deletion of menu, if another menu exists, show it +if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] ) + $nav_menu_selected_id = $nav_menus[0]->term_id; + +// Set $nav_menu_selected_id to 0 if no menus +if ( $one_theme_location_no_menus ) { + $nav_menu_selected_id = 0; +} elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) { + // if we have no selection yet, and we have menus, set to the first one in the list $nav_menu_selected_id = $nav_menus[0]->term_id; } @@ -423,11 +441,13 @@ if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) { // Generate truncated menu names foreach( (array) $nav_menus as $key => $_nav_menu ) { - $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) ); - if ( $_nav_menu->truncated_name != $_nav_menu->name ) - $_nav_menu->truncated_name .= '…'; + $nav_menus[$key]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '…' ); +} - $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name; +// Retrieve menu locations +if ( current_theme_supports( 'menus' ) ) { + $locations = get_registered_nav_menus(); + $menu_locations = get_nav_menu_locations(); } // Ensure the user will be able to scroll horizontally @@ -436,169 +456,310 @@ global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = 0; // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth -if ( is_nav_menu( $nav_menu_selected_id ) ) - $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); +if ( is_nav_menu( $nav_menu_selected_id ) ) { + $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) ); + $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); +} -function wp_nav_menu_max_depth() { +function wp_nav_menu_max_depth($classes) { global $_wp_nav_menu_max_depth; - return "menu-max-depth-$_wp_nav_menu_max_depth"; + return "$classes menu-max-depth-$_wp_nav_menu_max_depth"; } -add_action('admin_body_class','wp_nav_menu_max_depth'); +add_filter('admin_body_class', 'wp_nav_menu_max_depth'); wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); -if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() ) - echo '

' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

'; - -$help = '

' . __('This feature is new in version 3.0; to use a custom menu in place of your theme’s default menus, support for this feature must be registered in the theme’s functions.php file. If your theme does not support the custom menus feature yet (the new default theme, Twenty Ten, does), you can learn about adding support yourself by following the below link.') . '

'; -$help .= '

' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '

'; -$help .= '

' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. You’ll see when the position of the drop target shifts over to create the nested placement. Don’t forget to click Save when you’re finished.') . '

'; -$help .= '

' . __('For more information:') . '

'; -$help .= '

' . __('Menus Documentation') . '

'; -$help .= '

' . __('Support Forums') . '

'; - -add_contextual_help($current_screen, $help); +if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) + $messages[] = '

' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Custom Menu” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) ) . '

'; + +if ( ! $locations_screen ) : // Main tab + $overview = '

' . __( 'This screen is used for managing your custom navigation menus.' ) . '

'; + $overview .= '

' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Custom Menu” widget on the Widgets screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Thirteen', 'Twenty Twelve' ) . '

'; + $overview .= '

' . __( 'From this screen you can:' ) . '

'; + $overview .= ''; + + get_current_screen()->add_help_tab( array( + 'id' => 'overview', + 'title' => __( 'Overview' ), + 'content' => $overview + ) ); + + $menu_management = '

' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '

'; + $menu_management .= ''; + $menu_management .= '

' . __( 'You can assign theme locations to individual menus by selecting the desired settings at the bottom of the menu editor. To assign menus to all theme locations at once, visit the Manage Locations tab at the top of the screen.' ) . '

'; + + get_current_screen()->add_help_tab( array( + 'id' => 'menu-management', + 'title' => __( 'Menu Management' ), + 'content' => $menu_management + ) ); + + $editing_menus = '

' . __( 'Each custom menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '

'; + $editing_menus .= '

' . __( 'Clicking the arrow to the right of any menu item in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '

'; + $editing_menus .= ''; + + get_current_screen()->add_help_tab( array( + 'id' => 'editing-menus', + 'title' => __( 'Editing Menus' ), + 'content' => $editing_menus + ) ); +else : // Locations Tab + $locations_overview = '

' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '

'; + $locations_overview .= ''; + + get_current_screen()->add_help_tab( array( + 'id' => 'locations-overview', + 'title' => __( 'Overview' ), + 'content' => $locations_overview + ) ); +endif; + +get_current_screen()->set_help_sidebar( + '

' . __('For more information:') . '

' . + '

' . __('Documentation on Menus') . '

' . + '

' . __('Support Forums') . '

' +); // Get the admin header -require_once( 'admin-header.php' ); +require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+ + ' . sprintf( _n( 'Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '

'; + ?> + + + +
+ + + create a new menu.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?> + + +
+ + + + + + create a new menu.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?> + +
+ +
+ - - - +