From b27069117eb22c39d5230ceb39439f2dab82dc08 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 5 May 2022 03:24:33 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@53352 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/inline-edit-post.js | 4 ++++ src/wp-admin/includes/class-wp-posts-list-table.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/_enqueues/admin/inline-edit-post.js b/src/js/_enqueues/admin/inline-edit-post.js index 46fba439fb..640d747b41 100644 --- a/src/js/_enqueues/admin/inline-edit-post.js +++ b/src/js/_enqueues/admin/inline-edit-post.js @@ -294,6 +294,10 @@ window.wp = window.wp || {}; editRow = $('#inline-edit').clone(true); $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length ); + // Remove the ID from the copied row and let the `for` attribute reference the hidden ID. + $( 'td', editRow ).find('#quick-edit-legend').removeAttr('id'); + $( 'td', editRow ).find('p[id^="quick-edit-"]').removeAttr('id'); + $(t.what+id).removeClass('is-expanded').hide().after(editRow).after(''); // Populate fields in the quick edit window. diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 0e87b72abf..818abf48f6 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -1611,9 +1611,9 @@ class WP_Posts_List_Table extends WP_List_Table { ?> -
+
- +
post_type, 'title' ) ) : ?>