User capability per post

As far as I know, you can not (easily) set up a custom capability for a certain post/page ID. What is described in the Codex, are the so-called meta capabilities (a set of predefined capabilities with additional arguments/information). A (not-that-easy) way is to write your own my_add_cap, my_current_user_can, my_has_cap etc. functions. Regarding your follow-up question… … Read more

Restricted user capabilities cannot add image

You haven’t missed any capabilities. User should be able to insert images into the editor with these capabilities. The only problem I can think of is that, you are trying to modify the capabilities of a role which won’t work. See this section If you are defining a custom role, and adding capabilities to the … Read more

How to show a admin bar menu item only to users with certain capabilities?

The check will be called too early if you just write it in your plugin file like this: if ( current_user_can( ‘add_movies’ ) ) { add_action( ‘admin_bar_menu’, ‘wpse17689_admin_bar_menu’ ); } function wpse17689_admin_bar_menu( &$wp_admin_bar ) { $wp_admin_bar->add_menu( /* … */ ); } Because it will execute when your plugins is loaded, which is very early in … Read more

Filter list of rules based on a capability

Untested, but should be easily extendable(or something you can take ideas from). function roles_have_cap( $roles = false, $cap ) { global $wp_roles; if( !isset( $wp_roles ) || !isset( $cap ) ) return false; if( !$roles ) $roles = array_keys( $wp_roles->roles ); if( !is_array( $roles ) ) $roles = array( $roles ); $hascap = array(); foreach( … Read more

Allow users to set a post author

The edit_others_posts capability should allow users to set the author of a post. At first glance you might reply that you don’t want your authors to be able to edit one another’s posts. The difference in ability is very subtle though: writing a post and then assigning it to another user isn’t much different from … Read more