Easily? No, there’s nothing built in for that.
But the options it’s enabled for could potentially be filtered since that is pulled via get_options()… so the appropriate filter would be option_radio_button_for_taxonomies_options
I store the option as an array so the taxonomies key would be where the enabled taxonomies are.
This is a total guess… may have errors, may not work at all… but might be a starting point once you adjust some_tax and some_type to your situation. Good luck, I’ll be curious to know how it turns out though I can’t really dig too much deeper.
function kia_filter_radio_taxonomies( $options ) {
global $post;
if ( $post instanceof WP_Post ) {
$limited_taxonomy = 'some_tax';
$limited_post_type = 'some_type';
$post_type = get_post_type( $post );
$taxonomies = is_array( $options ) && isset( $options['taxonomies'] ) ? $options['taxonomies'] : array();
if ( $limited_post_type !== $post_type && ) {
unset( $taxonomies[ $limited_taxonomy] );
$options['taxonomies'] = $taxonomies;
}
}
return $options;
}
add_filter( 'option_radio_button_for_taxonomies_options', 'kia_filter_radio_taxonomies' );
Thanks, I think this is one of those features that is good to have fyi. I actually used this plugin and it works fine: https://ww.wp.xz.cn/plugins/select-all-categories-and-taxonomies-change-checkbox-to-radio-buttons/
I will make a note of it as a feature request, but this plugin doesn’t get a ton of new feature work (gotta pay the bills) and you’re actually the first person to ask about this in the 8 years of the plugin’s existence. 🙂
Glad you have a working solution.