Editor: Fix the JS to select, save, and update categories on the old Edit Post screen.

Reviewed by desrosj, azaozz.
Merges [59414] to the 6.7 branch.

Props: charleslf, im3dabasia1, desrosj, dhruvang21, Zargarov, sainathpoojary, azaozz.
Fixes: .

git-svn-id: https://develop.svn.wordpress.org/branches/6.7@59421 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2024-11-19 13:47:33 +00:00
parent 8a234cc061
commit 7f370353a9

@ -659,8 +659,10 @@ jQuery( function($) {
'li.popular-category > label input[type="checkbox"]',
function() {
var t = $(this), c = t.is(':checked'), id = t.val();
if ( id && t.parents('#taxonomy-'+taxonomy).length )
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
if ( id && t.parents('#taxonomy-'+taxonomy).length ) {
$('input[id^="in-' + taxonomy + '-' + id + '"]').prop('checked', c);
$('input#in-popular-' + taxonomy + '-' + id).prop('checked', c);
}
}
);