shawfactor / lh-user-taxonomies Goto Github PK
View Code? Open in Web Editor NEWThis is a WordPress plugin that extends the default taxonomy functionality to users
This is a WordPress plugin that extends the default taxonomy functionality to users
When the plugin YOAS SEO is activated this plugin stops working.
The registered user taxonomy stops appearing all together in the admin panel.
Please let me know if there is any other information you would like to help resolve this.
When trying to programatically insert a term, a WP_Error is returned from the wp_insert_term function.
Also, get_terms() does not return terms registered for users, I guess these might be correlated.
After upgrading to the current version of wordpress 4.7 registering a taxonomy does not seem to work any more.
Current code does not produce any errors, but the taxonomy is note registered, can't be seen int backend, etc.
add_action('set_current_user', function () {
write_log('registering taxonomies');
register_taxonomy('team', 'user', array(
'public' => true,
'single_value' => true,
'show_admin_column' => true,
'labels' => array(
'name' =>'Teams',
'singular_name' =>'Team',
'menu_name' =>'Teams',
'search_items' =>'Search teams',
'popular_items' =>'Popular teams',
'all_items' =>'All teams',
'edit_item' =>'Edit team',
'update_item' =>'Update Team',
'add_new_item' =>'Add New Team',
'new_item_name' =>'New Team Name',
'add_or_remove_items' =>'Add or remove teams',
'choose_from_most_used' =>'Choose from the most popular teams',
),
'capabilities' => array(
'manage_terms' =>'edit_users',
'edit_terms' =>'edit_users',
'delete_terms' =>'edit_users',
'assign_terms' =>'edit_users',
),
));
}, 10);
There seems to be a minor clash with BuddyPress. BP registers a taxonomy called bp_member_type
which is non-public, and is assigned to the user object. I'm not sure of the ins and outs of what BP does with this, but it ends up in this plugin's self::$taxonomies
array, which I'm not sure it's supposed to, and causes all manner of PHP notices and warnings because the right properties aren't defined.
If a single taxonomy term is assigned to a user, that taxonomy term cannot be taken away.
With a normal post, when all taxonomy terms are removed, the post is assigned to the Uncategorized category. Since there is not, by default, an Uncategorized term on the custom taxonomy, it re-selects the taxonomy term that was originally chosen and cannot be unselected until another taxonomy term is selected for the user.
My workaround for now was to create a NotAssigned taxonomy term and assign that whenever I needed to remove all other terms.
Registered new custom User Taxonomy called "Groups"
Created new Group called "Managers"
Clicked on "Edit" under the new Managers Group
"Posts" admin menu gets highlighted and expanded instead of remaining under Users-->Groups
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.