Make WordPress Core

Changeset 53352


Ignore:
Timestamp:
05/05/2022 03:24:33 AM (2 years ago)
Author:
peterwilsoncc
Message:

Quick/Bulk Edit: Remove duplicate HTML IDs.

Rename #inline-edit-legend to avoid duplicate HTML IDs. These have been renamed #quick-edit-legend and #bulk-edit-legend for the quick and bulk editors respectively.

This HTML ID is not required by the quick editor duplicated via JavaScript so is removed as part of the duplication process.

Follow up to [53096].

Props azaozz, costdev, greglone, hellofromtonya, ironprogrammer, joedolson, sabernhardt.
Fixes #55575.
See #35483.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/inline-edit-post.js

    r53096 r53352  
    294294        editRow = $('#inline-edit').clone(true);
    295295        $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
     296
     297        // Remove the ID from the copied row and let the `for` attribute reference the hidden ID.
     298        $( 'td', editRow ).find('#quick-edit-legend').removeAttr('id');
     299        $( 'td', editRow ).find('p[id^="quick-edit-"]').removeAttr('id');
    296300
    297301        $(t.what+id).removeClass('is-expanded').hide().after(editRow).after('<tr class="hidden"></tr>');
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r53116 r53352  
    16121612            <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="<?php echo $classes; ?>" style="display: none">
    16131613            <td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
    1614             <div class="inline-edit-wrapper" role="region" aria-labelledby="inline-edit-legend">
     1614            <div class="inline-edit-wrapper" role="region" aria-labelledby="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend">
    16151615            <fieldset class="inline-edit-col-left">
    1616                 <legend class="inline-edit-legend" id="inline-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>
     1616                <legend class="inline-edit-legend" id="<?php echo $bulk ? 'bulk' : 'quick'; ?>-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>
    16171617                <div class="inline-edit-col">
    16181618
Note: See TracChangeset for help on using the changeset viewer.