Categories not rendering as checked when editing a location.

Research

The problem stems from the JavaScript for locations: slp_power_location_edit.setup_edit

The IDs for the category checkboxes is:

in-stores-<category_id>-2

The script looks for locations WITHOUT the -2 suffix:

location_edit_options.form_div.find(
'#in-stores-' + jQuery(this).attr('data-value')
).prop('checked', true);
 

Adding a + ‘-2’ to the end of that string fixes the issue… but why does the ID have a -2 at the end in the first place… let’s dig deeper instead of just throwing a ‘-2’ on the end…

Fucking WordPress- they introduced Breaking Changes in 6.4.0

This is NOT documented as a breaking change.

In version 6.4.0 they introduced a new function \wp_unique_prefixed_id()
This is called by the checklist generator: \wp_terms_checklist()
Which is used via PHP to generate the Checklist template for categories for the Power editor.