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' );