How to assign multiple roles for capabilities array withini register_taxonomy function?

When assigning capabilities to ‘capabilities’ argument of register_taxonomy() you need to assign the capability and not the role! so use capabilities that only a specific role has eg: ‘capabilities’ => array ( ‘manage_terms’ => ‘manage_options’, //by default only admin ‘edit_terms’ => ‘manage_options’, ‘delete_terms’ => ‘manage_options’, ‘assign_terms’ => ‘edit_posts’ // means administrator’, ‘editor’, ‘author’, ‘contributor’ )

Custom taxonomies capabilities

Just like CPT capabilities those of taxonomy are also customizable, in register_taxonomy(): capabilities ‘manage_terms’ – ‘manage_categories’ ‘edit_terms’ – ‘manage_categories’ ‘delete_terms’ – ‘manage_categories’ ‘assign_terms’ – ‘edit_posts’ Since your authors only have edit_posts it works as you observe — they can assign existing terms, but not create them. You can customize capabilities for taxonomy in question and … Read more

Temporary capability for current_user_can()

Yes, just filter ‘user_has_cap’. You get an array with the current capabilities that you can change without touching the database. Sample Code add_filter( ‘user_has_cap’, ‘wpse_53230_catch_cap’, 10, 3 ); /** * See WP_User::has_cap() in wp-includes/capabilities.php * * @param array $allcaps Existing capabilities for the user * @param string $caps Capabilities provided by map_meta_cap() * @param array … Read more

What’s the difference between Role and Meta capabilities; When to use map_meta_cap() filter

difference between Role and Meta capabilities That would be better to ask the compare Role with Capabilities, not just Meta capabilities, but as a simple answer: A Role defines a set of tasks a user assigned the role is allowed to perform. Capabilities are assigned to Roles difference between Meta and Primitive capabilities? Meta capabilities … Read more

What’s the difference between the capability remove_users and delete_users?

The difference is really no difference in regular (single install) WordPress. It’s in a multisite install (network) where there is a difference. In multisite, only a Super Admin (who can manage everything on the network) has delete_users capability, while an “admin” (who would own/manage a single site) can remove_users from their site, but cannot delete … Read more