Define new user capability for custom post types?
Use ‘capability_type’ & ‘capabilities’ when you register_post_type().
Use ‘capability_type’ & ‘capabilities’ when you register_post_type().
You can use http://wordpress.org/extend/plugins/members/
Did you use ‘register_post_type’ ? If yes, you can add on supports parameters => ‘author’ ?
I believe your best bet is to create a custom post type for the certain posts you want editable by multiple authors. When you register your post assign a capability type (#WIKI# in this example) and then add the ‘edit_others_#WIKI#s’ to the author role.
By default, the author user role allows users to add, edit, and delete their own pages and posts, but disallows users to edit or delete others’ pages and posts; however, it does not, out of the box, limit users to the creation of a single page or post. If your intent is merely to allow … Read more
I tried to reproduce what you did. My subscriber role has the following capabilities: delete_messages delete_private_messages delete_published_messages edit_message edit_messages edit_private_messages edit_published_message publish_messages read I marked one of the capabilities “edit_message”. I don’t see this in your picture. But it was absolutely necessary for me to even post messages. Why does it work for you without … Read more
Just guessing, but maybe: $admin = get_role( __( ‘administrator’ ) ); If you’re trying to make sure that WP translates the string for a specific locale, __() will return the translated string. So if get_role(‘administrator’) works and on a French setup get_role(‘administrateur’) would work, then the above code snippet should do what you need.
current_user_can() checks for a capability, eg: edit_posts, not a role. The only capabilities subscribers have is read which only gives them access to the dashboard to change their profile (unless you added additional caps). They can’t even publish a post so you will have to start with contributors. $old_role = get_user_meta( $user_id, ‘wp_capabilities’ ); elseif … Read more
In your template: // rolename could for e.g. be ‘editor’ or ‘author’ or ‘administrator’ author_can( get_the_ID(), ‘rolename’ ) AND print “<img src=”https://wordpress.stackexchange.com/questions/56658/…” alt=”A kool badge!” />”;
Right after I wrote the posts I found it…anyway if someone else is looking for the answer to this, you need to set capabilities when you register your taxonomy. You add the following: ‘capabilities’ => array ( ‘manage_terms’ => ‘edit_posts’, ‘edit_terms’ => ‘edit_posts’, ‘delete_terms’ => ‘edit_posts’, ‘assign_terms’ => ‘edit_posts’ ) edit_posts means administrator’, ‘editor’, ‘author’ … Read more