Here’s the JS I use to replace checkboxes for radio buttons.
function checktoradio(){
echo '<script type="text/javascript">jQuery("#categorychecklist-pop input, #categorychecklist input, .cat-checklist input").each(function(){this.type="radio"});</script>';
}
add_action('admin_footer', 'checktoradio');
This would also work for custom terms, you just need to find out the custom term ID used by inspecting the metabox element.
You would place this code inside functions.php. It basically adds a jquery script to the footer of the admin pages.
Disclaimer: I found the original code a long time ago on some website and adapted for my own use.
Related Posts:
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Using register_activation_hook in classes
- WordPress URL Rewrite not working
- How to use update and delete query in wordpress
- add_meta_boxes action with refresh on save
- Saving metabox repeatable fields
- Resize Image without cropping
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- When is is_admin() available?
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- Hiding WordPress Plugin Source Code
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- wp_loaded hook block script enquequing
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How to find error in my code when the error message is pointing to WP core file?
- How to access global variable $menu inside a class function
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- How to upload a file to a folder named after the user_id via plugin
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Improve page speed loading using CDN and async or defer attribute
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- Script to browser problem PHP
- adjust section according to country?
- Store a default value for a transient on plugin activation
- wp query foreach deleting record returning only first or last item
- WordPress Custom field Colors
- how to update and display an option without reloading the page
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to use html inside a functions.php code?
- Plugin Generate Unexpected output during activation
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Undefined method class::construct() when creating a plugin
- Hook called before text widget save
- plugin add action hook is not working :
- zip unzip attachments in wordpress
- wpdb prepare insert table doesn’t work
- how to Update 15k products on plugin activation with meta_option
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- Hooks for post saving make a post-new.php to load latest post’s data
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- Adding Additional Variables on Menus Page
- custom plugin with upload files does not work
- Using flickr api in custom wordpress plugin
- Toolbar Hidden in a Virtual Page
- What is the difference between Null vs Empty (Zero Length) string?
- PHP: $_SESSION destroyed after page reload for my custom session
- send popup after wp_redirect()
- no_rest_route error on custom routes
- How to correctly escape an echo
- Payment field disappears on custom Paypal plugin
- Adding image upload in tag section – WordPress plugin development
- How to Remove Theme Style CSS inside Custom Plugin?
- Create ACF Checkbox to get all ACF Values from Parent Page
- I am having errors with checkout on wordpress
- File is executed twice if plugin is activating
- product_type_options get saved value [closed]
- Display a custom name when the user has no name settle in his account
- 400 bad request admin-ajax file upload
- get Woocommerce product format json for WP_Query
- Sum All the Post Meta of Published posts of Current Logged in user
- Update user meta when an external link in admin notice is clicked
- Is there an option to execute javascript file only on plugin activation
- How do I remove an action hook inside a class that is called by another class?
- The plugin generated 225 characters of unexpected output during activation
- Autoloading Classes in Plugins
- Ajax in a class instantiated via shortcode
- Parsing webhook from Shopify in WordPress
- Comparing Dates within plugin using PHP If statement
- Shortcode Works for Logged in Users but Not Working for Guest
- Submit to itself don’t work
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Singleton plugin activation; create database
- Send data from plugin to external database
- Why this plugin is not working?
- Permission error on plugin save
- How to get WordPress Adminmenu items?
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- How keep woocommerce users separeted in multisite install and keep admins on network
- base64_encode conflict with convert_smilies in wordpress
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Import users and custom user meta from csv
- Prevent users from display default wordpress login form
- Create custom table for wordpress custom registration flow
- Variable ++ in query loop
- Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?
- WordPress REST API – Custom field not added to pages
- WordPress wp_set_object_terms does not assign product to custom taxonomy
- Cannot register a custom WP-CLI command
- Why does WordPress not make use of gettext directly?