Walker_Category_Checklist should sometimes set the value as the term name
|Reported by:||simonwheatley||Owned by:|
The Walker_Category_Checklist class has been partially adapted to work with taxonomies other than category, but it does not seem to cope with non-hierachical taxonomies.
For non-hierachical taxonomies, the HTML form elements (checkboxes, radios, dropdowns, whatever) need to set the term name as the value, not the ID… otherwise WordPress will cast the ID to a string and create a new term with that string as a name.
To see the problem:
- Use Walker_Category_Checklist to create a checkbox in a metabox on the post edit screen for a non-hierarchical taxonomy
- Add some terms to the taxonomy
- Check the box for the taxonomy and update the post
- Watch a new term appear with its name set to the ID of the term you checked
Change History (6)
comment:1 simonwheatley — 12 months ago
- Component changed from General to Template
- Keywords has-patch dev-feedback added