I work on this plugin in my spare time for free, so I can’t promise when/if I’ll be able to update it. I’m open to collaboration/assistance at https://github.com/helgatheviking/radio-buttons-for-taxonomies
Seems the most reasonable approach by now is to add a custom meta box taking care of that while hiding the built-in meta box at the same time.
https://wordpress.org/plugins/categories-metabox-enhanced/ does the first part of adding a custom meta box. And in a review for that plugin https://wordpress.org/support/topic/almost-perfect-even-in-gutenberg/#post-11206035 I pasted a little snippet which does the hiding part.
Do you think sounds like a good approach? We then need to distinguish somehow if Gutenberg or no Gutenberg and fire logic accordingly. Quite some work to do.
Hey all,
I’ve found this code snippet: https://github.com/WordPress/gutenberg/tree/master/packages/editor/src/components/post-taxonomies#custom-taxonomy-selector
And it seems like the best, most-Gutenberg way forward. I’m able to use it to replace the core panel, but I’m still a little stuck trying to find a way to modify the existing element instead of rewriting their entire wp.components.HierarchicalTermSelector function.
I will also say that I was very surprised to learn that add|remove_meta_box seemed to work and the radio inputs are in the Gutenberg panel… and save the data correctly. So in short term, it might be OK use a different metabox content (and remove the old tabs/scripts). Though I don’t think the add term buttons work. @destinedjagold this appears to be the approach that plugin is taking. I would still prefer a Gutenberg approach, but I’m still so new to React that it’s very slow going.
@leymannx and @destinedjagold I’ve got something _started_ in the dev branch at Github:
https://github.com/helgatheviking/Radio-Buttons-for-Taxonomies/tree/dev
If you’re up for testing or helping in any way, that would certainly help it along.
Uh Helga, that’s good news and very much appreciated. The radio buttons appear on the chosen taxonomies. Though the click behavior is a little bit odd, when you click through them the first time. AND when saving it seems to always save all terms, although (thanks to the radios) only one was selected.
I’ll leave you issues on GitHub then, OK?