How to add taxonomy to Users menu in admin?

I want to create a taxonomy that is related to the users, therefore I'd like to show the taxonomy under "Users" menu within wordpress admin. In codex there's a mention that you can attach taxonomy to "nav_menu_item" but I can't find any working example of how this works. If I use:

register_taxonomy( 'expertise', array( 'nav_menu_item' ), $args );

or

register_taxonomy( 'expertise', array( 'users' ), $args );

it doesn't work.

Any help would be much appreciated.

Topic admin-menu custom-taxonomy Wordpress

Category Web


Take a look here if you want to code:

http://justintadlock.com/archives/2011/10/20/custom-user-taxonomies-in-wordpress

There are also plugins inspired by that post. Also, a massive open source plugin that goes even further is Groups:

https://github.com/itthinx/groups


The register_taxonomy function is designed only for adding taxonomies to existing post types and custom post types. It's not something that can be expanded to users.

I have just tried a couple of plugins that work with taxonomies and neither are able to attach a taxonomy to a user.

from http://codex.wordpress.org/Function_Reference/register_taxonomy :

Usage

<?php register_taxonomy( $taxonomy, $object_type, $args ); ?>

$object_type (array/string) (required) Name of the object type for the taxonomy object. Object-types can be built-in Post Type or any Custom Post Type that may be registered.

Builtin Post Types:

  • post

  • page

  • attachment
  • revision
  • nav_menu_item.

Custom Post Types:

  • {custom_post_type} - Custom Post Type names must be all in lower-case and without any spaces.

  • null - Setting explicitly to null registers the taxonomy but doesn't associate it with any objects, so it won't be directly available within the Admin UI. You will need to manually register it using the 'taxonomy' parameter (passed through $args) when registering a custom post_type (see register_post_type()), or using register_taxonomy_for_object_type().

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.