helgatheviking / Radio-Buttons-for-Taxonomies

Turn any WordPress taxonomy into a list of radio buttons, which forces users to select only 1 term!
53 stars 28 forks source link
custom-metabox hacktoberfest radio-taxonomies wordpress-taxonomy

Radio Buttons for Taxonomies

Contributors: helgatheviking
Donate link: https://www.paypal.me/kathyisawesome
Tags: taxonomy, admin, interface, ui, post, radio, terms, metabox
Requires at least: 4.5.0
Tested up to: 6.1.0
Stable tag: 2.4.7
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Description

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

Support

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

Installation

  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

Screenshots

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

Frequently Asked Questions

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

Changelog

2023.03.18 - Version 2.4.7

2023.02.15 - Version 2.4.6

2023.02.13 - Version 2.4.5

2022.06.28 - Version 2.4.4

2022.06.15 - Version 2.4.3

2022.01.06 - Version 2.4.2

2021.12.27 - Version 2.4.1

2021.12.27 - Version 2.4.0

2.3.1

Removed 'tabify_add_meta_boxes' action, as it is doubled by do_action( 'add_meta_boxes')in settings-posttype.php of Tabify Edit Screen.

2.3.0

2.2.3

2.2.2

2.2.1

2.2.0

2.1.1

2.1.0

2.0.8

2.0.7

2.0.6

2.0.5

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

1.8.3

1.8.2

1.8.1

1.8.0

1.7.8

1.7.7

1.7.6

1.7.5

1.7.4

1.7.3

1.7.2

1.7.1

1.7.0

1.6.1

1.6

1.5.6

1.5.5

1.5.4

1.5.3

1.5.2

1.5.1

1.5

1.4.5

1.4.4

1.4.3

1.4.2

1.4.1

1.4

1.3

1.2.5

1.2.4

1.2.3

1.2.2

1.2.1

1.2

1.1.4

1.1.3

1.1.2

1.1.1

1.1

1.0.3

1.0.2

1.0.1

1.0