wpscholar / wp-taxonomy-radio-group
A WordPress walker class and function for rendering a taxonomy radio group.
Installs: 4 976
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/wpscholar/wp-taxonomy-radio-group
This package is auto-updated.
Last update: 2025-09-29 02:02:06 UTC
README
A WordPress walker class and function for rendering a taxonomy radio group.
Getting Started
The anticipated use case for this is removing the normal hierarchical taxonomy metabox from the WordPress admin and replacing with a custom metabox with radio buttons (as opposed to the normal checkboxes).
For example, here is how to replace the standard categories metabox on the post edit screen with our own custom one:
<?php add_action( 'admin_menu', function () { $taxonomy = get_taxonomy( 'category' ); add_meta_box( "{$taxonomy->name}div", $taxonomy->label, function () use ( $taxonomy ) { echo wp_tax_radio_group( $taxonomy->name ); }, 'post', 'side' ); } );