To Reproduce:
- Edit a post that is categorized under some "Most Used" category. Let's assume that category is called "Bartleby".
- Uncheck "Bartleby" from "All Categories".
- Save and Continue Editing.
- Notice that the post still has category Bartleby.
In the above example, Bartleby is still checked under "Most Used".
Attached syncs the two checklists:
- Most Used checklist starts with nothing checked and is hidden from users without JS.
- On load, the Most Used checklist is synced with the normal checklist.
- Whenever a checkbox is checked, that checkbox is synced between the two checklists.
- Most Used cats added by AJAX (can happen if adding a sub cat or typing the name of the cat in the AJAX input rather than looking for the checkbox) are told to sync as well.
- Only the checkboxes from the "All Categories" list are sent when saving a post.
Attached introduces:
- New CSS class: wp-no-js-hidden which is set to display: none;. On load, the class is removed from all elements via JS.
Also Fixes:
- Add new category "submit" link now a button.
- Parent Category Dropdown selectedIndex bug.