From 6f2676296a5f973e99bfbf64369d073e7a8a4a05 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Wed, 8 Nov 2023 17:20:24 -0700
Subject: [PATCH] Fix 11302 in a different way than was done in r56712, which
was revered in r57094 because it introduced a bug.
---
src/js/_enqueues/admin/inline-edit-post.js | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/js/_enqueues/admin/inline-edit-post.js b/src/js/_enqueues/admin/inline-edit-post.js
index 1f572353ff..cb7a8c3f6f 100644
a
|
b
|
window.wp = window.wp || {}; |
180 | 180 | var te = '', type = this.type, c = true; |
181 | 181 | var checkedPosts = $( 'tbody th.check-column input[type="checkbox"]:checked' ); |
182 | 182 | var categories = {}; |
183 | | var indeterminatePostCategoryField = $( '<input type="hidden" name="indeterminate_post_category[]">' ); |
184 | 183 | this.revert(); |
185 | 184 | |
186 | 185 | $( '#bulk-edit td' ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length ); |
… |
… |
window.wp = window.wp || {}; |
234 | 233 | |
235 | 234 | // Compute initial states. |
236 | 235 | $( '.inline-edit-categories input[name="post_category[]"]' ).each( function() { |
237 | | // Clear indeterminate states. |
238 | | $( '<input type="hidden" name="indeterminate_post_category[]">' ).remove(); |
239 | | |
240 | 236 | if ( categories[ $( this ).val() ] == checkedPosts.length ) { |
241 | 237 | // If the number of checked categories matches the number of selected posts, then all posts are in this category. |
242 | 238 | $( this ).prop( 'checked', true ); |
… |
… |
window.wp = window.wp || {}; |
245 | 241 | $( this ).prop( 'indeterminate', true ); |
246 | 242 | |
247 | 243 | // Set indeterminate states for the backend. |
248 | | indeterminatePostCategoryField.val( $( this ).val() ); |
249 | | $( this ).after( indeterminatePostCategoryField ); |
| 244 | $( this ).after( '<input type="hidden" name="indeterminate_post_category[] value="' + $( this ).val() + '"'>' ); |
250 | 245 | } |
251 | 246 | } ); |
252 | 247 | |