<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23810] trunk/wp-admin: Move nav menus to a tabbed interface, so that users with a lot of locations can do bulk assignment.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23810">23810</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-03-27 11:46:08 +0000 (Wed, 27 Mar 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move nav menus to a tabbed interface, so that users with a lot of locations can do bulk assignment.
props DrewAPicture, lessbloat. fixes <a href="http://core.trac.wordpress.org/ticket/23770">#23770</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsswpadminrtlcss">trunk/wp-admin/css/wp-admin-rtl.css</a></li>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadminjsnavmenujs">trunk/wp-admin/js/nav-menu.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsswpadminrtlcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin-rtl.css (23809 => 23810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin-rtl.css        2013-03-27 08:58:40 UTC (rev 23809)
+++ trunk/wp-admin/css/wp-admin-rtl.css        2013-03-27 11:46:08 UTC (rev 23810)
</span><span class="lines">@@ -697,6 +697,9 @@
</span><span class="cx"> .fixed .column-comments a {
</span><span class="cx">         float: right;
</span><span class="cx"> }
</span><ins>+.fixed .column-menus {
+        text-align: right;
+}
</ins><span class="cx"> .sorting-indicator {
</span><span class="cx">         margin-left: 0;
</span><span class="cx">         margin-right: 7px;
</span><span class="lines">@@ -2083,6 +2086,27 @@
</span><span class="cx">         float: right;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.menu-location-menus select {
+        float: right;
+}
+
+.locations-row-links {
+        float: right;
+        margin: 4px 6px 0 0;
+}
+
+.locations-add-menu-link {
+        direction: rtl;
+}
+
+.locations-edit-menu-link {
+        border-left: 1px solid #CCCCCC;
+        border-right: 0;
+        padding-left: 6px;
+        padding-right: 0;
+        float: right;
+}
+
</ins><span class="cx"> /* Menu Container */
</span><span class="cx"> #menu-management-liquid {
</span><span class="cx">         float: right;
</span></span></pre></div>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (23809 => 23810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2013-03-27 08:58:40 UTC (rev 23809)
+++ trunk/wp-admin/css/wp-admin.css        2013-03-27 11:46:08 UTC (rev 23810)
</span><span class="lines">@@ -2423,6 +2423,7 @@
</span><span class="cx">         width: 8%;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.fixed .column-posts,
</ins><span class="cx"> .fixed .column-date,
</span><span class="cx"> .fixed .column-parent,
</span><span class="cx"> .fixed .column-links,
</span><span class="lines">@@ -2439,6 +2440,14 @@
</span><span class="cx">         width: 15%;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.fixed .column-slug {
+        width: 25%;
+}
+
+.fixed .column-locations {
+        width: 35%;
+}
+
</ins><span class="cx"> .fixed .column-comments {
</span><span class="cx">         width: 4em;
</span><span class="cx">         padding: 8px 0;
</span><span class="lines">@@ -2453,14 +2462,6 @@
</span><span class="cx">         float: left;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.fixed .column-slug {
-        width: 25%;
-}
-
-.fixed .column-posts {
-        width: 10%;
-}
-
</del><span class="cx"> .fixed .column-icon {
</span><span class="cx">         width: 80px;
</span><span class="cx"> }
</span><span class="lines">@@ -2547,6 +2548,10 @@
</span><span class="cx">         margin-top: 3px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#menu-locations-wrap .widefat {
+        width: 60%;
+}
+
</ins><span class="cx"> .widefat th.sortable,
</span><span class="cx"> .widefat th.sorted {
</span><span class="cx">         padding: 0;
</span><span class="lines">@@ -7384,7 +7389,7 @@
</span><span class="cx">
</span><span class="cx"> #nav-menus-frame {
</span><span class="cx">         margin-left: 300px;
</span><del>-        margin-top: 28px;
</del><ins>+        margin-top: 23px;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #wpbody-content #menu-settings-column {
</span><span class="lines">@@ -7401,7 +7406,8 @@
</span><span class="cx">         margin: 10px 0 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.metabox-holder-disabled .postbox {
</del><ins>+.metabox-holder-disabled .postbox,
+.metabox-holder-disabled .accordion-section-content {
</ins><span class="cx">         opacity: 0.5;
</span><span class="cx">         filter: alpha(opacity=50);
</span><span class="cx"> }
</span><span class="lines">@@ -7432,7 +7438,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .manage-menus {
</span><del>-        margin-top: 13px;
</del><ins>+        margin-top: 23px;
</ins><span class="cx">         padding: 10px;
</span><span class="cx">         overflow: hidden;
</span><span class="cx">         -webkit-border-radius: 3px;
</span><span class="lines">@@ -7566,6 +7572,39 @@
</span><span class="cx">         margin-top: -2px;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.widefat td.menu-location-menus {
+        padding-bottom: 5px;
+}
+
+.menu-location-menus select {
+        float: left;
+}
+
+#locations-nav-menu-wrapper {
+        padding: 5px 0;
+}
+
+.locations-nav-menu-select select {
+        float: left;
+        width: 160px;
+        margin-right: 5px;
+}
+
+.locations-row-links {
+        float: left;
+        margin: 6px 0 0 6px;
+}
+
+.locations-edit-menu-link,
+.locations-add-menu-link {
+        margin: 0 3px;
+}
+
+.locations-edit-menu-link {
+        padding-right: 3px;
+        border-right: 1px solid #ccc;
+}
+
</ins><span class="cx"> #wpbody .open-label {
</span><span class="cx">         display: block;
</span><span class="cx">         float:left;
</span></span></pre></div>
<a id="trunkwpadminjsnavmenujs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.js (23809 => 23810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.js        2013-03-27 08:58:40 UTC (rev 23809)
+++ trunk/wp-admin/js/nav-menu.js        2013-03-27 11:46:08 UTC (rev 23810)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx">                         if ( menus.oneThemeLocationNoMenus )
</span><span class="cx">                                 $( '#posttype-page' ).addSelectedToMenu( api.addMenuItemToBottom );
</span><span class="cx">
</span><ins>+                        this.initManageLocations();
+
</ins><span class="cx">                         this.initAccessibility();
</span><span class="cx">
</span><span class="cx">                         this.initToggles();
</span><span class="lines">@@ -735,6 +737,19 @@
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><span class="cx">
</span><ins>+                initManageLocations : function () {
+                        $('#menu-locations-wrap form').submit(function(){
+                                window.onbeforeunload = null;
+                        });
+                        $('.menu-location-menus select').on('change', function () {
+                                var editLink = $(this).closest('tr').find('.locations-edit-menu-link');
+                                if ($(this).find('option:selected').data('orig'))
+                                        editLink.show();
+                                else
+                                        editLink.hide();
+                        });
+                },
+
</ins><span class="cx">                 attachMenuEditListeners : function() {
</span><span class="cx">                         var that = this;
</span><span class="cx">                         $('#update-nav-menu').bind('click', function(e) {
</span><span class="lines">@@ -927,11 +942,11 @@
</span><span class="cx">                 },
</span><span class="cx">
</span><span class="cx">                 attachUnsavedChangesListener : function() {
</span><del>-                        $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea').change(function(){
</del><ins>+                        $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').change(function(){
</ins><span class="cx">                                 api.registerChange();
</span><span class="cx">                         });
</span><span class="cx">
</span><del>-                        if ( 0 != $('#menu-to-edit').length ) {
</del><ins>+                        if ( 0 != $('#menu-to-edit').length || 0 != $('.menu-location-menus select').length ) {
</ins><span class="cx">                                 window.onbeforeunload = function(){
</span><span class="cx">                                         if ( api.menusChanged )
</span><span class="cx">                                                 return navMenuL10n.saveAlert;
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (23809 => 23810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2013-03-27 08:58:40 UTC (rev 23809)
+++ trunk/wp-admin/nav-menus.php        2013-03-27 11:46:08 UTC (rev 23810)
</span><span class="lines">@@ -37,6 +37,11 @@
</span><span class="cx"> // The menu id of the current menu being edited
</span><span class="cx"> $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
</span><span class="cx">
</span><ins>+// Get existing menu locations assignments
+$locations = get_registered_nav_menus();
+$menu_locations = get_nav_menu_locations();
+$num_locations = count( array_keys( $locations ) );
+
</ins><span class="cx"> // Allowed actions: add, update, delete
</span><span class="cx"> $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';
</span><span class="cx">
</span><span class="lines">@@ -262,10 +267,6 @@
</span><span class="cx">         case 'update':
</span><span class="cx">                 check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );
</span><span class="cx">
</span><del>-                // Get existing menu locations assignments
-                $locations = get_registered_nav_menus();
-                $menu_locations = get_nav_menu_locations();
-
</del><span class="cx">                 // Remove menu locations that have been unchecked
</span><span class="cx">                 foreach ( $locations as $location => $description ) {
</span><span class="cx">                         if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id )
</span><span class="lines">@@ -307,7 +308,15 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                                 set_theme_mod( 'nav_menu_locations', $locations );
</span><span class="cx">                                         }
</span><del>-                                        $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';
</del><ins>+                                        if ( isset( $_REQUEST['use-location'] ) ) {
+                                                $locations = get_theme_mod( 'nav_menu_locations' );
+                                                if ( isset( $locations[$_REQUEST['use-location']] ) )
+                                                        $locations[$_REQUEST['use-location']] = $nav_menu_selected_id;
+                                                set_theme_mod( 'nav_menu_locations', $locations );
+                                        }
+                                        // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';
+                                        wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );
+                                        exit();
</ins><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><span class="cx">                                 $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
</span><span class="lines">@@ -341,6 +350,20 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><ins>+        case 'locations':
+                add_filter( 'screen_options_show_screen', '__return_false' );
+
+                if ( isset( $_POST['menu-locations'] ) ) {
+                        check_admin_referer( 'save-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 );
+
+                        $messages[] = '<div id="message" class="updated"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
+                }
+                break;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Get all nav menus
</span><span class="lines">@@ -350,6 +373,8 @@
</span><span class="cx"> // Are we on the add new screen?
</span><span class="cx"> $add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;
</span><span class="cx">
</span><ins>+$locations_screen = ( isset( $_GET['action'] ) && 'locations' == $_GET['action'] ) ? true : false;
+
</ins><span class="cx"> // If we have one theme location, and zero menus, we take them right into editing their first menu
</span><span class="cx"> $page_count = wp_count_posts( 'page' );
</span><span class="cx"> $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
</span><span class="lines">@@ -474,19 +499,82 @@
</span><span class="cx"> ?>
</span><span class="cx"> <div class="wrap">
</span><span class="cx">         <?php screen_icon(); ?>
</span><del>-        <h2><?php _e( 'Menus' ); ?> <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, ), admin_url( 'nav-menus.php' ) ) ); ?>" class="add-new-h2"><?php _ex( 'Add New', 'menu' ); ?></a></h2>
</del><ins>+        <h2 class="nav-tab-wrapper">
+                <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
+                <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php if ( $locations_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a>
+        </h2>
</ins><span class="cx">         <?php
</span><span class="cx">         foreach( $messages as $message ) :
</span><span class="cx">                 echo $message . "\n";
</span><span class="cx">         endforeach;
</span><span class="cx">         ?>
</span><ins>+        <?php
+        if ( $locations_screen ) :
+                echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu you would like to use below.', 'Your theme supports %s menus. Select a menu to use for each theme location below.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
+        ?>
+        <div id="menu-locations-wrap">
+                <form method="post" action="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                        <table class="widefat fixed" cellspacing="0" id="menu-locations-table">
+                                <thead>
+                                <tr>
+                                        <th scope="col" class="manage-column column-locations"><?php _e( 'Theme Location' ); ?></th>
+                                        <th scope="col" class="manage-column column-menus"><?php _e( 'Assigned Menu' ); ?></th>
+                                </tr>
+                                </thead>
+                                <!--<tfoot>
+                                <tr>
+                                        <th scope="col" class="manage-column column-locations"><?php _e( 'Theme Location' ); ?></th>
+                                        <th scope="col" class="manage-column column-menus"><?php _e( 'Assigned Menu' ); ?></th>
+                                </tr>
+                                </tfoot>-->
+                                <tbody class="menu-locations">
+                                <?php foreach ( $locations as $_location => $_name ) { ?>
+                                        <tr id="menu-locations-row">
+                                                <td class="menu-location-title"><strong><?php echo $_name; ?></strong></td>
+                                                <td class="menu-location-menus">
+                                                        <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
+                                                                <option value="0"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>
+                                                                <?php foreach ( $nav_menus as $menu ) : ?>
+                                                                        <?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?>
+                                                                        <option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
+                                                                                <?php $truncated_name = wp_html_excerpt( $menu->name, 40 );
+                                                                                echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '&hellip;'; ?>
+                                                                        </option>
+                                                                <?php endforeach; ?>
+                                                        </select>
+                                                        <div class="locations-row-links">
+                                                                <?php if ( isset( $menu_locations[ $_location ] ) && 0 != $menu_locations[ $_location ] ) : ?>
+                                                                <span class="locations-edit-menu-link">
+                                                                        <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => $menu_locations[$_location] ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                                                                                <?php _ex( 'Edit', 'menu' ); ?>
+                                                                        </a>
+                                                                </span>
+                                                                <?php endif; ?>
+                                                                <span class="locations-add-menu-link">
+                                                                        <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, 'use-location' => $_location ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                                                                                <?php _ex( 'Use new menu', 'menu' ); ?>
+                                                                        </a>
+                                                                </span>
+                                                        </div><!-- #locations-row-links -->
+                                                </td><!-- .menu-location-menus -->
+                                        </tr><!-- #menu-locations-row -->
+                                <?php } // foreach ?>
+                                </tbody>
+                        </table>
+                        <p class="button-controls"><?php submit_button( __( 'Save Changes' ), 'primary left', 'nav-menu-locations', false ); ?></p>
+                        <?php wp_nonce_field( 'save-menu-locations' ); ?>
+                        <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+                </form>
+        </div><!-- #menu-locations-wrap -->
+        <?php do_action( 'after_menu_locations_table' ); ?>
+        <?php else : ?>
</ins><span class="cx">         <div class="manage-menus">
</span><del>-        <?php if ( $menu_count < 2 ) : ?>
</del><ins>+                 <?php if ( $menu_count < 2 ) : ?>
</ins><span class="cx">                 <span class="add-edit-menu-action">
</span><span class="cx">                         <?php printf( __( 'Edit your menu below, or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
</span><span class="cx">                 </span><!-- /add-edit-menu-action -->
</span><del>-        <?php else : ?>
-                <form method="get" action="">
</del><ins>+                <?php else : ?>
+                        <form method="get" action="<?php echo admin_url( 'nav-menus.php' ); ?>">
</ins><span class="cx">                         <input type="hidden" name="action" value="edit" />
</span><span class="cx">                         <label for="menu" class="selected-menu"><?php _e( 'Select a menu to edit:' ); ?></label>
</span><span class="cx">                         <select name="menu" id="menu">
</span><span class="lines">@@ -578,6 +666,9 @@
</span><span class="cx">                                                         <?php endif; ?>
</span><span class="cx">                                                         <?php if ( $add_new_screen ) : ?>
</span><span class="cx">                                                                 <p class="post-body-plain"><?php _e( 'Give your menu a name above, then click Create Menu.' ); ?></p>
</span><ins>+                                                                <?php if ( isset( $_GET['use-location'] ) ) : ?>
+                                                                        <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
+                                                                <?php endif; ?>
</ins><span class="cx">                                                         <?php endif; ?>
</span><span class="cx">                                                         <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>>
</span><span class="cx">                                                                 <h3><?php _e( 'Menu Settings' ); ?></h3>
</span><span class="lines">@@ -633,5 +724,6 @@
</span><span class="cx">                 </div><!-- /#menu-management -->
</span><span class="cx">         </div><!-- /#menu-management-liquid -->
</span><span class="cx">         </div><!-- /#nav-menus-frame -->
</span><ins>+        <?php endif; ?>
</ins><span class="cx"> </div><!-- /.wrap-->
</span><span class="cx"> <?php include( './admin-footer.php' ); ?>
</span></span></pre>
</div>
</div>
</body>
</html>