<!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>[59265] trunk/src: Menus: A11y: Set the parent and order using select fields.</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 { white-space: pre-line; 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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/59265">59265</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/59265","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>joedolson</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-10-21 19:53:10 +0000 (Mon, 21 Oct 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Menus: A11y: Set the parent and order using select fields.

Add `select` inputs to allow users to set the parent and position of items in the menu settings. Fixes a significant problem for screen reader users that makes updating menus extremely tedious, since the options for moving items do not explicitly set a position. This is also a significant improvement for all users manipulating large menus.

This could easily be considered an enhancement, but while it is a minor enhancement for most users, it is transformative for screen reader users in managing menus, moving that interface from nearly unusable to very manageable.

Props javad2000, audrasjb, juliemoynat, williamalexander, rcreators, milamj, joedolson. 
Fixes <a href="https://core.trac.wordpress.org/ticket/43305">#43305</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueueslibnavmenujs">trunk/src/js/_enqueues/lib/nav-menu.js</a></li>
<li><a href="#trunksrcwpadmincssnavmenuscss">trunk/src/wp-admin/css/nav-menus.css</a></li>
<li><a href="#trunksrcwpadminincludesclasswalkernavmenueditphp">trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php</a></li>
<li><a href="#trunksrcwpadminnavmenusphp">trunk/src/wp-admin/nav-menus.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjs_enqueueslibnavmenujs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/lib/nav-menu.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/lib/nav-menu.js    2024-10-21 14:11:56 UTC (rev 59264)
+++ trunk/src/js/_enqueues/lib/nav-menu.js      2024-10-21 19:53:10 UTC (rev 59265)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,6 +216,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                        checkboxes.prop( 'checked', false );
</span><span class="cx" style="display: block; padding: 0 10px">                                                        t.find( '.button-controls .select-all' ).prop( 'checked', false );
</span><span class="cx" style="display: block; padding: 0 10px">                                                        t.find( '.button-controls .spinner' ).removeClass( 'is-active' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                        t.updateParentDropdown();
+                                                       t.updateOrderDropdown();
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 });
</span><span class="cx" style="display: block; padding: 0 10px">                                        });
</span><span class="cx" style="display: block; padding: 0 10px">                                },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,6 +290,105 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                });
</span><span class="cx" style="display: block; padding: 0 10px">                                        });
</span><span class="cx" style="display: block; padding: 0 10px">                                        return this;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                },
+                               updateParentDropdown : function() {
+                                       return this.each(function(){
+                                               var menuItems = $( '#menu-to-edit li' ),
+                                                       parentDropdowns = $( '.edit-menu-item-parent' );
+
+                                               $.each( parentDropdowns, function() {
+                                                       var parentDropdown = $( this ),
+                                                               $html = '',
+                                                               $selected = '',
+                                                               currentItemID = parentDropdown.closest( 'li.menu-item' ).find( '.menu-item-data-db-id' ).val(),
+                                                               currentparentID = parentDropdown.closest( 'li.menu-item' ).find( '.menu-item-data-parent-id' ).val(),
+                                                               currentItem = parentDropdown.closest( 'li.menu-item' ),
+                                                               currentMenuItemChild = currentItem.childMenuItems(),
+                                                               excludeMenuItem = [ currentItemID ];
+
+                                                       if ( currentMenuItemChild.length > 0 ) {
+                                                               $.each( currentMenuItemChild, function(){
+                                                                       var childItem = $(this),
+                                                                               childID = childItem.find( '.menu-item-data-db-id' ).val();
+
+                                                                       excludeMenuItem.push( childID );
+                                                               });
+                                                       }
+
+                                                       if ( currentparentID == 0 ) {
+                                                               $selected = 'selected';
+                                                       }
+
+                                                       $html += '<option ' + $selected + ' value="0">No Parent</option>';
+
+                                                       $.each( menuItems, function() {
+                                                               var menuItem = $(this),
+                                                               $selected = '',
+                                                               menuID = menuItem.find( '.menu-item-data-db-id' ).val(),
+                                                               menuTitle = menuItem.find( '.edit-menu-item-title' ).val();
+
+                                                               if ( ! excludeMenuItem.includes( menuID ) ) {
+                                                                       if ( currentparentID == menuID ) {
+                                                                               $selected = 'selected';
+                                                                       }
+                                                                       $html += '<option ' + $selected + ' value="' + menuID + '">' + menuTitle + '</option>';
+                                                               }
+                                                       });
+
+                                                       parentDropdown.html( $html );
+                                               });
+                                               
+                                       });
+                               },
+                               updateOrderDropdown : function() {
+                                       return this.each( function() {
+                                               var itemPosition,
+                                                       orderDropdowns = $( '.edit-menu-item-order' );
+
+                                               $.each( orderDropdowns, function() {
+                                                       var orderDropdown = $( this ),
+                                                               menuItem = orderDropdown.closest( 'li.menu-item' ).first(),
+                                                               depth = menuItem.menuItemDepth(),
+                                                               isPrimaryMenuItem = ( 0 === depth ),
+                                                               $html = '',
+                                                               $selected = '';
+
+                                                       if ( isPrimaryMenuItem ) {
+                                                               var primaryItems = $( '.menu-item-depth-0' ),
+                                                                       totalMenuItems = primaryItems.length;
+
+                                                               itemPosition = primaryItems.index( menuItem ) + 1;
+
+                                                               for ( let i = 1; i < totalMenuItems + 1; i++ ) {
+                                                                       $selected = '';
+                                                                       if ( i == itemPosition ) { 
+                                                                               $selected = 'selected';
+                                                                       }
+                                                                       $html += '<option ' + $selected + ' value="' + i + '">' + i + ' of ' + totalMenuItems + '</option>';
+                                                               }
+
+                                                       } else {
+                                                               var parentItem = menuItem.prevAll( '.menu-item-depth-' + parseInt( depth - 1, 10 ) ).first(),
+                                                                       parentItemId = parentItem.find( '.menu-item-data-db-id' ).val(),
+                                                                       subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemId + '"]' ),
+                                                                       totalSubMenuItems = subItems.length;
+
+                                                               itemPosition = $( subItems.parents('.menu-item').get().reverse() ).index( menuItem ) + 1;
+
+                                                               for ( let i = 1; i < totalSubMenuItems + 1; i++ ) {
+                                                                       $selected = '';
+                                                                       if ( i == itemPosition ) {
+                                                                               $selected = 'selected';
+                                                                       }
+                                                                       $html += '<option ' + $selected + ' value="' + i + '">' + i + ' of ' + totalSubMenuItems + '</option>';
+                                                               }
+
+                                                       }
+
+                                                       orderDropdown.html( $html );
+                                               });
+                                               
+                                       });
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -297,7 +398,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                moveMenuItem : function( $this, dir ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px">                         var items, newItemPosition, newDepth,
</span><span class="cx" style="display: block; padding: 0 10px">                                menuItems = $( '#menu-to-edit li' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                menuItemsCount = menuItems.length,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -400,6 +500,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        api.registerChange();
</span><span class="cx" style="display: block; padding: 0 10px">                        api.refreshKeyboardAccessibility();
</span><span class="cx" style="display: block; padding: 0 10px">                        api.refreshAdvancedAccessibility();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        thisItem.updateParentDropdown();
+                       thisItem.updateOrderDropdown();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( a11ySpeech ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                wp.a11y.speak( a11ySpeech );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -431,9 +533,126 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), dir );
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       // Set menu parents data for all menu items.
+                       menu.updateParentDropdown();
+
+                       // Set menu order data for all menu items.
+                       menu.updateOrderDropdown();
+
+                       // Update menu item parent when value is changed.
+                       menu.on( 'change', '.edit-menu-item-parent', function() {
+                               api.changeMenuParent( $( this ) );
+                       });
+                       
+                       // Update menu item order when value is changed.
+                       menu.on( 'change', '.edit-menu-item-order', function() {
+                               api.changeMenuOrder( $( this ) );
+                       });
</ins><span class="cx" style="display: block; padding: 0 10px">                 },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * changeMenuParent( [parentDropdown] )
+                * 
+                * @since 6.7.0
+                *
+                * @param {object} parentDropdown select field
+                */
+               changeMenuParent : function( parentDropdown ) {
+                       var menuItemNewPosition,
+                               menuItems = $( '#menu-to-edit li' ),
+                               $this = $( parentDropdown ),
+                               newParentID = $this.val(),
+                               menuItem = $this.closest( 'li.menu-item' ).first(),
+                               menuItemOldDepth = menuItem.menuItemDepth(),
+                               menuItemChildren = menuItem.childMenuItems(),
+                               menuItemNoChildren = parseInt( menuItem.childMenuItems().length, 10 ),
+                               parentItem = $( '#menu-item-' + newParentID ),
+                               parentItemDepth = parentItem.menuItemDepth(),
+                               menuItemNewDepth = parseInt( parentItemDepth ) + 1;
+
+                       if ( newParentID == 0 ) {
+                               menuItemNewDepth = 0;
+                       }
+
+                       menuItem.find( '.menu-item-data-parent-id' ).val( newParentID );
+                       menuItem.moveHorizontally( menuItemNewDepth, menuItemOldDepth );
+
+                       if ( menuItemNoChildren > 0 ) {
+                               menuItem = menuItem.add( menuItemChildren );
+                       }
+                       menuItem.detach();
+
+                       menuItems = $( '#menu-to-edit li' );
+
+                       var     parentItemPosition = parseInt( parentItem.index(), 10 ),
+                               parentItemNoChild = parseInt( parentItem.childMenuItems().length, 10 );
+
+                       if ( parentItemNoChild > 0 ){
+                               menuItemNewPosition = parentItemPosition + parentItemNoChild;
+                       } else {
+                               menuItemNewPosition = parentItemPosition;
+                       }
+
+                       if ( newParentID == 0 ) {
+                               menuItemNewPosition = menuItems.length - 1;
+                       }
+
+                       menuItem.insertAfter( menuItems.eq( menuItemNewPosition ) ).updateParentMenuItemDBId().updateParentDropdown().updateOrderDropdown();
+
+                       api.registerChange();
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
+                       $this.trigger( 'focus' );
+                       wp.a11y.speak( menus.parentUpdated, 'polite' );
+               },
+
+               /**
+                * changeMenuOrder( [OrderDropdown] )
+                * 
+                * @since 6.7.0
+                *
+                * @param {object} orderDropdown select field
+                */
+               changeMenuOrder : function( orderDropdown ) {
+                       var menuItems = $( '#menu-to-edit li' ),
+                               $this = $( orderDropdown ),
+                               newOrderID = parseInt( $this.val(), 10),
+                               menuItem = $this.closest( 'li.menu-item' ).first(),
+                               menuItemChildren = menuItem.childMenuItems(),
+                               menuItemNoChildren = menuItemChildren.length,
+                               menuItemCurrentPosition = parseInt( menuItem.index(), 10 ),
+                               parentItemID = menuItem.find( '.menu-item-data-parent-id' ).val(),
+                               subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemID + '"]' ),
+                               currentItemAtPosition = $(subItems[newOrderID - 1]).closest( 'li.menu-item' );
+
+                       if ( menuItemNoChildren > 0 ) {
+                               menuItem = menuItem.add( menuItemChildren );
+                       }
+
+                       var currentItemNoChildren = currentItemAtPosition.childMenuItems().length,
+                               currentItemPosition = parseInt( currentItemAtPosition.index(), 10 );
+
+                       menuItems = $( '#menu-to-edit li' );
+
+                       var     menuItemNewPosition = currentItemPosition;
+
+                       if(menuItemCurrentPosition > menuItemNewPosition){
+                               menuItemNewPosition = currentItemPosition;
+                               menuItem.detach().insertBefore( menuItems.eq( menuItemNewPosition ) ).updateOrderDropdown();
+                       } else {
+                               menuItemNewPosition = menuItemNewPosition + currentItemNoChildren;
+                               menuItem.detach().insertAfter( menuItems.eq( menuItemNewPosition ) ).updateOrderDropdown();
+                       }
+
+                       api.registerChange();
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
+                       $this.trigger( 'focus' );
+                       wp.a11y.speak( menus.orderUpdated, 'polite' );
+               },
+
+               /**
</ins><span class="cx" style="display: block; padding: 0 10px">                  * refreshAdvancedAccessibilityOfItem( [itemToRefresh] )
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><span class="cx" style="display: block; padding: 0 10px">                 * Refreshes advanced accessibility buttons for one menu item.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -737,6 +956,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        api.refreshKeyboardAccessibility();
</span><span class="cx" style="display: block; padding: 0 10px">                                        api.refreshAdvancedAccessibility();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        ui.item.updateParentDropdown();
+                                       ui.item.updateOrderDropdown();
</ins><span class="cx" style="display: block; padding: 0 10px">                                         api.refreshAdvancedAccessibilityOfItem( ui.item.find( 'a.item-edit' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                                },
</span><span class="cx" style="display: block; padding: 0 10px">                                change: function(e, ui) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -988,6 +1209,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        deletionSpeech = menus.itemsDeleted.replace( '%s', itemsPendingDeletion );
</span><span class="cx" style="display: block; padding: 0 10px">                                        wp.a11y.speak( deletionSpeech, 'polite' );
</span><span class="cx" style="display: block; padding: 0 10px">                                        that.disableBulkSelection();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        menus.updateParentDropdown();
+                                       menus.updateOrderDropdown();
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                        });
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1527,6 +1750,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        api.refreshAdvancedAccessibility();
</span><span class="cx" style="display: block; padding: 0 10px">                                        wp.a11y.speak( menus.itemRemoved );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        menus.updateParentDropdown();
+                                       menus.updateOrderDropdown();
</ins><span class="cx" style="display: block; padding: 0 10px">                                 });
</span><span class="cx" style="display: block; padding: 0 10px">                },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpadmincssnavmenuscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/nav-menus.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/nav-menus.css      2024-10-21 14:11:56 UTC (rev 59264)
+++ trunk/src/wp-admin/css/nav-menus.css        2024-10-21 19:53:10 UTC (rev 59265)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -827,24 +827,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">        display: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.menu-item-settings .description-thin,
-.menu-item-settings .description-wide {
-       margin-right: 10px;
-       float: left;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.description-group {
+       display: flex;
+       column-gap: 10px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.description-thin {
-       width: calc(50% - 5px);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.description-group > * {
+       flex-grow: 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.menu-item-settings .description-thin + .description-thin {
-       margin-right: 0;
-}
-
-.description-wide {
-       width: 100%;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .menu-item-actions {
</span><span class="cx" style="display: block; padding: 0 10px">        padding-top: 15px;
</span><span class="cx" style="display: block; padding: 0 10px">        padding-bottom: 7px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -951,8 +942,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        .menu-item-bar .menu-item-handle,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .menu-item-settings,
-       .description-wide {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .menu-item-settings {
</ins><span class="cx" style="display: block; padding: 0 10px">                 width: auto;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -960,9 +950,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                padding: 10px;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .menu-item-settings .description-thin,
-       .menu-item-settings .description-wide {
-               width: 100%;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .menu-item-settings .description-group {
+               display: block;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        .menu-item-settings input {
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswalkernavmenueditphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php        2024-10-21 14:11:56 UTC (rev 59264)
+++ trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php  2024-10-21 19:53:10 UTC (rev 59265)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,18 +218,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                <?php _e( 'Open link in a new tab' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">                                        </label>
</span><span class="cx" style="display: block; padding: 0 10px">                                </p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <p class="field-css-classes description description-thin">
-                                       <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
-                                               <?php _e( 'CSS Classes (optional)' ); ?><br />
-                                               <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode( ' ', $menu_item->classes ) ); ?>" />
-                                       </label>
-                               </p>
-                               <p class="field-xfn description description-thin">
-                                       <label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
-                                               <?php _e( 'Link Relationship (XFN)' ); ?><br />
-                                               <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->xfn ); ?>" />
-                                       </label>
-                               </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <div class="description-group">
+                                       <p class="field-css-classes description description-thin">
+                                               <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
+                                                       <?php _e( 'CSS Classes (optional)' ); ?><br />
+                                                       <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode( ' ', $menu_item->classes ) ); ?>" />
+                                               </label>
+                                       </p>
+                                       <p class="field-xfn description description-thin">
+                                               <label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
+                                                       <?php _e( 'Link Relationship (XFN)' ); ?><br />
+                                                       <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->xfn ); ?>" />
+                                               </label>
+                                       </p>
+                               </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <p class="field-description description description-wide">
</span><span class="cx" style="display: block; padding: 0 10px">                                        <label for="edit-menu-item-description-<?php echo $item_id; ?>">
</span><span class="cx" style="display: block; padding: 0 10px">                                                <?php _e( 'Description' ); ?><br />
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -240,6 +242,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                <?php
</span><span class="cx" style="display: block; padding: 0 10px">                                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 * Update parent and order of menu item using select inputs.
+                                *
+                                * @since 6.7.0
+                                */
+                               ?>
+       
+                               <div class="field-move-combo description-group">
+                                       <p class="description description-wide">
+                                               <label for="edit-menu-item-parent-<?php echo $item_id; ?>">
+                                                       <?php _e( 'Menu Parent' ); ?>
+                                               </label>
+                                               <select class="edit-menu-item-parent widefat" id="edit-menu-item-parent-<?php echo $item_id; ?>" name="menu-item-parent[<?php echo $item_id; ?>]">
+                                               </select>
+                                       </p>
+                                       <p class="description description-wide">
+                                               <label for="edit-menu-item-order-<?php echo $item_id; ?>">
+                                                       <?php _e( 'Menu Order' ); ?>
+                                               </label>
+                                               <select class="edit-menu-item-order widefat" id="edit-menu-item-order-<?php echo $item_id; ?>" name="menu-item-order[<?php echo $item_id; ?>]">
+                                               </select>
+                                       </p>
+                               </div>
+
+                               <?php
+                               /**
</ins><span class="cx" style="display: block; padding: 0 10px">                                  * Fires just before the move buttons of a nav menu item in the menu editor.
</span><span class="cx" style="display: block; padding: 0 10px">                                 *
</span><span class="cx" style="display: block; padding: 0 10px">                                 * @since 5.4.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,4 +347,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">                <?php
</span><span class="cx" style="display: block; padding: 0 10px">                $output .= ob_get_clean();
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpadminnavmenusphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/nav-menus.php  2024-10-21 14:11:56 UTC (rev 59264)
+++ trunk/src/wp-admin/nav-menus.php    2024-10-21 19:53:10 UTC (rev 59265)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -597,6 +597,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        'movedTop'                => __( 'Menu item moved to the top' ),
</span><span class="cx" style="display: block; padding: 0 10px">        'movedLeft'               => __( 'Menu item moved out of submenu' ),
</span><span class="cx" style="display: block; padding: 0 10px">        'movedRight'              => __( 'Menu item is now a sub-item' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        'parentUpdated'           => __( 'Menu parent updated' ),
+       'orderUpdated'            => __( 'Menu order updated' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>