LH User Taxonomies

Description

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.

All tickets for the project are being tracked on GitHub.

Installation

  1. Upload the lh-user-taxonomies folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use register_taxonomy as shown in the description

FAQ

Installation Instructions
  1. Upload the lh-user-taxonomies folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Use register_taxonomy as shown in the description

Reviews

Read all 4 reviews

Contributors & Developers

“LH User Taxonomies” is open source software. The following people have contributed to this plugin.

Contributors

Translate “LH User Taxonomies” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0 February 28, 2015
* Initial release

1.2 July 15, 2015
* Code improvements

1.3 July 17, 2015
* Documentation links

1.41 August 31, 2015
* Fix for saving taxonomies on profile when you need to remove term – thanks Greumb

1.50 March 04, 2016
* Added bulk edit functionality

1.50 March 04, 2016
* Added bulk edit functionality

1.52 February 22, 2017
* Buildtree bug fix

1.53 April 27, 2017
* registered_taxonomy fix

1.54 April 30, 2017
* added show_in_menu support

1.55 May 15, 2017
* better single value check

1.56 July 27, 2017
* added class check