Custom Role cannot assign taxonomies
-
Hello there,
I’m using the WooCommerce Product Vendors plugin where some new roles are added. One of them in particular is called “Vendor Admin” and when a user that belongs to this role add/edit one of their own products, they cannot assign a Taxonomy created with CPT UI that was prepared in advance by an Administrator.
They see only the box (in this case called Countries) and inside written “No tags” in it, with no other options available.
I did some research and found a topic here that probably does what I’m asking for but I tried to implement it with no success.
I added the following to my functions.php file:
//Add CPT UI to Vendors function cptui_taxonomy_caps( $args, $taxonomy ) { if ( 'country' == $taxonomy ) { $args['capabilities'] = array( 'assign_terms' => 'assign_' . $taxonomy, ); } return $args; } add_filter( 'cptui_pre_register_taxonomy', 'cptui_taxonomy_caps', 10, 2 );
I then installed the “User Roles and Capabilities” plugin, created a new capability called “assign_terms” and assigned that to the “Vendor Admin” user role.
When logging in as a Vendor Admin, I can see no changes.
Could someone kindly help me with this?
Best,
Arky
- The topic ‘Custom Role cannot assign taxonomies’ is closed to new replies.