[wp-hackers] User Capabilities

Ryan Boren ryan at boren.nu
Tue Jul 19 14:38:19 GMT 2005


On Sun, 2005-07-17 at 21:58 -0400, Owen Winkler wrote:
> Michael D Adams wrote:
> > On Jul 17, 2005, at 3:54 PM, Owen Winkler wrote:
> > 
> >> No, this resolves to the general capability 'edit_posts'.  Just 
> >> remember to pass the post ID as a second parameter to the 
> >> current_user_can() function, like:
> >>
> >>
> >> current_user_can('edit_posts', $post_id)
> >>
> > 
> > Do you mean 'edit_posts' or 'edit_post'  (plural or singular)?  It seems 
> > 'edit_post' is the the meta capability we're looking for here.
> > --Michael
> 
> Yeah, what's that all about?  It's "edit_post" not "edit_posts".  That 
> is, with "edit_post" supply a post ID, as if to ask "current user can 
> edit post #4?"
> 
> Asking "current user can edit posts #4" makes less sense.

If we're doing that somewhere, it's broken.

To clarify for everyone, edit_posts is the primitive cap used to
determine if a user has the generic "can edit posts" capability.
edit_post is a meta cap that determines whether the user has the
capability to edit a specific post. edit_post requires a post ID.
edit_posts does not.

Ryan



More information about the wp-hackers mailing list