[wp-hackers] Custom Post Type + Capabilities & Roles

Joaquin Rodriguez Montero yojoaquin at gmail.com
Sun Jun 27 20:31:20 UTC 2010


Based on your code I added:
'capabilities' => array( 'edit_post' => 'guest_question','edit_posts' =>
And that allowed me to submit it for review.

I couldn't succeed to show the new post type on any other user than the
guest blogger.. does this bit helps what are you trying to achieve?



Message: 2
Date: Sun, 27 Jun 2010 09:57:34 -0400
From: Jake Goldman <wphackers at jakemgold.myfastmail.com>
Subject: Re: [wp-hackers] Custom Post Type + Capabilities & Roles
To: wp-hackers at lists.automattic.com
Message-ID: <4C2758CE.2080204 at jakemgold.myfastmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Exactly what happens to me. I'm fairly convinced at this point it's just
an obscure bug. Even if it there's a way around this (Andrew?) it seems
like this is a reasonable use case that just doesn't work as one should
expect. You shouldn't be able to get to the "Add New" screen only to be
presented with, effectively, a "you can't add this" error.

Will submit to trac later today.


On 6/27/2010 9:09 AM, Brent Shepherd wrote:
> Based on my experimentation, if a user had only the "edit_questions"
> capability, they would be able to view the "Questions" admin page, as well
> as the "Add Question" page. However, when entering a question on the "Add
> Question" page, the auto save script would throw a "You are not allowed to
> edit this post" error at the bottom of the edit box. When they click
> for Review" WordPress dies showing the "You are not allowed to edit this
> post" error.
> Andrew, have you created a custom post type with a custom capability and
> successfully been able to recreate a contributor role using just
> "edit_{custom_post}"? I haven't been able to make it work.

More information about the wp-hackers mailing list