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

I am not sure how to add multiple capabilities to ‘assign_terms’ capability. My code is below, notice the capabilities array within the register_taxonomy function /* Registers taxonomies. */ function cflnk_wod_score_register_taxonomies() { /* Set up the artist taxonomy arguments. */ $wod_name_args = array( ‘hierarchical’ => false, ‘query_var’ => ‘wod_name’, ‘show_tagcloud’ => true, ‘rewrite’ => array( ‘slug’ … Read more

Custom taxonomies capabilities

I have registered several custom taxonomies for a custom post type. Code for one of them is the following: $labels = array( ‘name’ => __( ‘Genre’, ‘textdomain’ ), ‘singular_name’ => __( ‘Genre’, ‘textdomain’ ), ‘search_items’ => __( ‘Search Genres’, ‘textdomain’ ), ‘all_items’ => __( ‘All Genres’, ‘textdomain’ ), ‘parent_item’ => __( ‘Parent Genre’, ‘textdomain’ ), … Read more

Temporary capability for current_user_can()

Is it possible to intercept calls to current_user_can() ? Example: current_user_can(‘rate’, $post_id) There’s no “rate” capability registered, but could I somehow hook into that function and do my own checks, without having to register a role capability? 1 1 Yes, just filter ‘user_has_cap’. You get an array with the current capabilities that you can change … Read more

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

I’m getting very confused about the following things: difference between Role and Meta capabilities, difference between Meta and Primitive capabilities, when to use map_meta_cap() filter. There were lots of situations, where I add WP existing or custom capabilities to either WP existing or custom roles, expecting it to work out of the box and most … Read more

Allow Editors to edit pending posts but not draft ones

I have a large number of users with Editor Capabilities that help to go through the post submissions. This is my current setup for this role: As you can see, they are allowed to edit_posts and edit_others_posts but they cannot edit_published_posts. This means that they can edit posts that are in Draft and Pending status. … Read more

What do unfiltered_html and unfiltered_upload actually filter?

Among WordPress’ capabilities are unfiltered_html and unfiltered_upload, however I have yet to find any documentation about what specifically they allow or prevent in their filtering. The only mention I’ve found on WordPress’ site about unfiltered_html is: Allows user to post HTML markup or even JavaScript code in pages, posts, comments and widgets. I’ve seen that … Read more

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

In the list of capabilities, I found there’s both remove_users and delete_users. It’s not clear to me what remove_users is supposed to do, the Codex documentation just says it was introduced in version 3.0 (https://wordpress.org/support/article/roles-and-capabilities/). 2 s 2 The difference is really no difference in regular (single install) WordPress. It’s in a multisite install (network) … Read more

User-edit role setting distinct from wp_capabilities? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 1 year ago. Improve this question I need find out how $profileuser->roles is set. wp_capabilities can hold multiple roles, whereas user-edit role caters only for a single … Read more

How can I create a taxonomy meta-box with search suggestions but no new terms input?

I was wondering how I could setup a taxonomy metabox on a post edit page that would be similar to the “tags” kind (with search field and automatic suggestions), but without the right to add a new term. So for example if I’m typign a word, I get suggestions of terms that I can use … Read more