Make WordPress Core


Ignore:
Timestamp:
09/30/2025 05:00:43 PM (2 months ago)
Author:
desrosj
Message:

Grouped backports for the 6.5 branch.

  • REST API: Increase the specificity of capability checks for collections when the edit context is in use.
  • Menus: Prevent HTML in menu item titles from being rendered unexpectedly.

Merges [60814], [60815], [60816] to the 6.5 branch.

Props andraganescu, desrosj, ehti, hurayraiit, iandunn, joehoyle, johnbillion, jorbin, mnelson4, noisysocks, peterwilsoncc, phillsav, rmccue, timothyblynjacobs, vortfu, westonruter , whyisjake, zieladam.

Location:
branches/6.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/js/_enqueues/lib/nav-menu.js

    r54855 r60821  
    10101010
    10111011                if ( this.checked === true ) {
    1012                     $( '#pending-menu-items-to-delete ul' ).append(
    1013                         '<li data-menu-item-id="' + menuItemID + '">' +
    1014                             '<span class="pending-menu-item-name">' + menuItemName + '</span> ' +
    1015                             '<span class="pending-menu-item-type">(' + menuItemType + ')</span>' +
    1016                             '<span class="separator"></span>' +
    1017                         '</li>'
    1018                     );
     1012                    const $li = $( '<li>', { 'data-menu-item-id': menuItemID } );
     1013                    $li.append( $( '<span>', {
     1014                        'class': 'pending-menu-item-name',
     1015                        text: menuItemName
     1016                    } ) );
     1017                    $li.append( ' ' );
     1018                    $li.append( $( '<span>', {
     1019                        'class': 'pending-menu-item-type',
     1020                        text: '(' + menuItemType + ')',
     1021                    } ) );
     1022                    $li.append( $( '<span>', { 'class': 'separator' } ) );
     1023                    $( '#pending-menu-items-to-delete ul' ).append( $li );
    10191024                }
    10201025
     
    14051410
    14061411        eventOnClickMenuSave : function() {
    1407             var locs = '',
    1408             menuName = $('#menu-name'),
    1409             menuNameVal = menuName.val();
     1412            var menuName = $('#menu-name'),
     1413                menuNameVal = menuName.val();
    14101414
    14111415            // Cancel and warn if invalid menu name.
     
    14151419            }
    14161420            // Copy menu theme locations.
     1421            // Note: This appears to be dead code since #nav-menu-theme-locations no longer exists, perhaps removed in r32842.
     1422            var $updateNavMenu = $('#update-nav-menu');
    14171423            $('#nav-menu-theme-locations select').each(function() {
    1418                 locs += '<input type="hidden" name="' + this.name + '" value="' + $(this).val() + '" />';
    1419             });
    1420             $('#update-nav-menu').append( locs );
     1424                $updateNavMenu.append(
     1425                    $( '<input>', {
     1426                        type: 'hidden',
     1427                        name: this.name,
     1428                        value: $( this ).val(),
     1429                    } )
     1430                );
     1431            });
    14211432            // Update menu item position data.
    14221433            api.menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
     
    14611472
    14621473            if( ! $items.length ) {
    1463                 $('.categorychecklist', panel).html( '<li><p>' + wp.i18n.__( 'No results found.' ) + '</p></li>' );
     1474                const li = $( '<li>' );
     1475                const p = $( '<p>', { text: wp.i18n.__( 'No results found.' ) } );
     1476                li.append( p );
     1477                $('.categorychecklist', panel).empty().append( li );
    14641478                $( '.spinner', panel ).removeClass( 'is-active' );
    14651479                wrapper.addClass( 'has-no-menu-item' );
Note: See TracChangeset for help on using the changeset viewer.