LH User Taxonomies

plugin banner

Simplify the process of adding support for custom taxonomies for Users. Just use `register_taxonomy` and everything else is taken care of.

Author:Peter Shaw (profile at wordpress.org)
WordPress version required:4.0
WordPress version tested:5.7.2
Plugin version:1.61
Added to WordPress repository:04-03-2015
Last updated:21-03-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:8
Plugin URI:https://lhero.org/portfolio/lh-user-taxonomie...
Total downloads:8 496
Active installs:500+
plugin download
Click to start download

This plugin extends the default taxonomy functionality and extends it to users, while automating all the boilerplate code.

Once activated, you can register user taxonomies using the following code:

register_taxonomy('profession', 'user', array(
    'public'        =>true,
    'single_value' => false,
    'show_admin_column' => true,
    'labels'        =>array(
        'name'                      =>'Professions',
        'singular_name'             =>'Profession',
        'menu_name'                 =>'Professions',
        'search_items'              =>'Search Professions',
        'popular_items'             =>'Popular Professions',
        'all_items'                 =>'All Professions',
        'edit_item'                 =>'Edit Profession',
        'update_item'               =>'Update Profession',
        'add_new_item'              =>'Add New Profession',
        'new_item_name'             =>'New Profession Name',
        'separate_items_with_commas'=>'Separate professions with commas',
        'add_or_remove_items'       =>'Add or remove professions',
        'choose_from_most_used'     =>'Choose from the most popular professions',
    ),
    'rewrite'       =>array(
        'with_front'                =>true,
        'slug'                      =>'author/profession',
    ),
    'capabilities'  => array(
        'manage_terms'              =>'edit_users',
        'edit_terms'                =>'edit_users',
        'delete_terms'              =>'edit_users',
        'assign_terms'              =>'read',
    ),
));

Read more about registering taxonomies in the codex
This is heavily inspired by previous work by Justin Tadlock and also forks Damian Gostomskis plugin in the repository to add additional functionality, including:

  • Fixes a bug with display of existing user taxonomies in the user-edit screen
  • Fixes a bug with taxonomy count in the old plugin where deleting users did not update the count
  • Add support for ‘single_value’ attribute when registering a user taxonomy for taxonomies which should only have one value.
  • Properly supports the capabilities associated with the taxonomy when registered.
  • Supports ‘show_admin_column’ attribute when registering the taxonomy in the same way as post taxonomies.
  • Where ‘show_admin_column’ is true admins can assign user taxonomies using bulk edit functionality.

Check out our documentation for more information on how to register user taxonomies.

Like this plugin? Please consider leaving a 5-star review.

Love this plugin or want to help the LocalHero Project? Please consider making a donation.


FAQ
ChangeLog