Radio Buttons for Taxonomies

Mô tả

Replace the default taxonomy boxes with a custom metabox that uses radio buttons… effectively limiting each post to a single term in that taxonomy.

A plugin options page allows the user can select which taxonomies she’d like to switch to using the custom radio-button style metabox.

Originally based on the the class by Stephen Harris

Hỗ trợ

Support is handled in the WordPress forums. Please note that support is limited and does not cover any custom implementation of the plugin. Before posting a question, read the FAQ and confirm that the problem still exists with a default theme and with all other plugins disabled.

Please report any bugs, errors, warnings, code problems to Github

Ảnh màn hình

  • The settings page where you determine which taxonomies will get radio buttons.
  • This is what the metabox will look like on the post editor screen.

Cài đặt

  1. Upload the plugin folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to Settings > Radio Buttons for Taxonomies and use the checkboxes to indicate which taxonomies you’d like to use radio buttons

Hỏi đáp

Why do the metaboxes have a “No {$taxonomy}” ( ex: No Genre ) radio button!?

This was a feature added in version 1.4, but due to some faulty logic on my part probably wasn’t showing it everywhere that I intended.

It has come to my attention that not everybody likes this feature, so I have enabled an easy way to disable it for taxonomies that you wish to make mandatory. Simply add the following to your theme’s functions.php or your site’s custom functions plugin.

add_filter( "radio_buttons_for_taxonomies_no_term_{$taxonomy}", "__return_FALSE" );

So for example, to disabled the “No term” option on a taxonomy called “genre” you’d do the following:

add_filter( 'radio_buttons_for_taxonomies_no_term_genre', '__return_FALSE' );

Đánh giá

14 Tháng Bảy, 2020
I always review the code of plugin I use. I would like to congratulate the Author of this plugin, this is one of the best I've ever read All WordPress feature are respected, all data are correctly escaped, all methods are correctly named, design pattern implementation is good, PHP expert features are mastered. Great job ! (Why the constructor of Radio_Buttons_For_Taxonomies isn't private ? )
3 Tháng Sáu, 2020
Plugin works well and updated, fast answer on support forum. keep going.
20 Tháng Mười Hai, 2019
Installed the plugin, 2 seconds to configure which taxonomies I want to convert and it just works. Seriously good.
Đọc tất cả 45 đánh giá

Người đóng góp & Lập trình viên

“Radio Buttons for Taxonomies” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp

“Radio Buttons for Taxonomies” đã được dịch qua 6 ngôn ngữ. Cảm ơn những người tham gia dịch vì đóng góp của họ.

Dịch “Radio Buttons for Taxonomies” sang ngôn ngữ của bạn.

Muốn tham gia phát triển?

Duyệt code, check out SVN repository, hoặc theo dõi nhật ký phát triển qua RSS.

Nhật ký thay đổi


  • Fix: Refactor sidebar script to remove unneeded higher order components. Props @torounit!
  • Fix: Add core class to radio buttons in sidebar. Props @torounit!


  • Fix: Missing index.asset.php file.


  • Fix: “No {$term}” not translatable.


  • Fix: Vulnerable nonce in save routine.


  • Fix: Admin settings- Get all taxonomies with show_ui=true.


  • Fix: Settings link on plugin page.


  • Fix: Stop breaking quick edit on Taxonomy pages.



  • Fix: Fatal error use_block_editor_for_post_type() undefined in WP 4.x


  • Gutenberg compatibility! Props @5ally and @leymannx


  • Escape all the inputs. Props @tomjn and @rtCamp


  • Friendlier error messages


  • Fix: fatal error for undefined boolval in PHP < 5.5


  • Compatibility with WordPress 4.9.2
  • Update donation link
  • Add radio_buttons_for_taxonomies_no_term_selected_text filter to allow for custom “No Genre” texts. props @hokoo
  • Convert switch_terms_filter() to get and setter
  • Rename radio-buttons-for-taxonomies-no-term-$taxonomy filter to radio_buttons_for_taxonomies_no_term_$taxonomy to disable the “No term” feature


  • Compatibility with WordPress 4.8.3
  • Update donation link


  • Compatibility with WordPress 4.4


  • Validate options against get_all_taxonomies() which allows for private taxonomies to be saved in options if they’ve been added via filter


  • Add Dutch translation. props @maarten00
  • Add Persian translation. props @Ghaem


  • Add German translation. props @carstingaxion


  • Use “singular” label for metabox. props @lchski


  • Fixes popular terms


  • add minified script to svn repo


  • Add support for bulk-edit
  • more quick edit fixes
  • save tax terms for attachments
  • switch ajax callback for adding non-hierarchical terms
  • use default JS scripts on post.php page
  • remove filtering of columns via manage_{$post_type}_posts_custom_column, etc
  • switch all taxonomies to “hierarchical” on edit.php so quick edit is automatically switched to radio buttons


  • Bug-fix for quick-edit


  • Use later priority (99) to launch the WordPress_Radio_Taxonomy class instances, resolves bug with custom taxonomies
  • Switch to class instance initialization instead of global
  • filtering "manage_taxonomies_for_{$post_type}_columns" doesn’t do anything to quickedit, so removed
  • removed disable_ui() method in favor of adding to manage_{$post_type}_posts_custom_column hook
    ** this lets us keep the taxonomy columns in their original places, versus adding to end
    ** currently no way to remove quick edit without disabling UI in global $wp_taxonomies variable
  • better docbloc


  • fix PHP notice in class.WordPress_Radio_Taxonomy.php


  • verify WP 3.8 compatibility


  • Fix PHP warnings in class.Walker_Category_Radio.php


  • Fix error on edit screen if taxonomy is deleted


  • Fix untranslatable string
  • Add Arabic translation thanks to @hassanhamm


  • Load admin scripts only where needed, fixes conflict on edit-terms screens


  • Move launch of WordPress_Radio_Taxonomy class to init hook
  • Move no-term filter inside get_terms() method which should make the proposed FAQ solution for disabling the “No term” work now


  • Enabled “No {$taxonomy}” in quick edit
  • Changed column headers to use the singular taxonomy label
  • Respect the show_admin_column argument when registering taxonomy
  • Automatically unset default taxonomy column (if conventionally named) to prevent duplicate columns


  • Change generic “No term” to “No {$taxonomy}”, ex: “No Genre”


  • Fix PHP warning in metabox related to “No term”
  • Fix conditional logic for “No term” option
  • Added filter to disabled “No term”
  • Fixed “Add new” term WPLists markup


  • Fix fatal error on settings update


  • Fix “No term” option showing in non-radio taxonomies


  • Add “No term” option to taxonomy metaboxes


  • fix problem with adding new terms, #7


  • fix markdown for changelog


  • return changelog to readme.txt


  • fix PHP notice
  • fix popular/all clicking for WP 3.5.1
  • move changelog to own file


  • Still fixing SVN


  • Hopeful fix of SVN failure to include class.Walker_Category_Radio.php in v1.2 – SVN Is not my strong suit. Sorry for any inconvenience!


  • change donation URL
  • fixed save bug for users without the manage_categories


  • Correct plugin URL
  • fixed quick edit bug
  • fixed undefined $post variable warning


  • Code cleanup


  • Removed unneeded localize_script object
  • Fix fatal error on multisite ( caused by using an anonymous function when not supported until PHP 5.3)
  • Fixed quick edit refresh ( second click on quick edit for same item and the value still reflected the original)


  • Fix notice in popular terms tab
  • Attempted fix fatal error on multisite


  • Added columns to edit screen for every radio taxonomy
  • Add quick edit for all radio taxonomies
  • Enforce limit of single terms via save_post
  • fixed error with taxonomy object property not being loaded on the right hook
  • fixed uninstall hook
  • fixed saving of ‘delete’ option


  • updated donate link


  • fixed incorrect plugin settings link
  • fixed variable scope in javascript that was preventing plugin from working on multiple metaboxes


  • bug fix for when no taxonomies are selected


  • Initial release.