[wp-hackers] Custom Role and Custom Post Types

Steve Taylor steve at sltaylor.co.uk
Sun Feb 13 14:15:30 UTC 2011


Jesse,

You probably need to pay attention to the capabilities-related
argument of register_post_type:

http://codex.wordpress.org/Function_Reference/register_post_type#Arguments

I don't know how you're creating the new role - I used Justin
Tadlock's Members plugin, which also allows customization of the
role's capabilities. In tandem with the above arguments, I've been
able to do this kind of thing.

As for creating the new post on registration, yeah, I think you're on
the right track with the new registration hook.

cheers,

Steve Taylor

On 13 February 2011 13:42, SWORD Studios <info at swordstudios.net> wrote:
> Thanks in advance for any help I get with this.
>
> I've defined a new role in wordpress called Designer.
> I've create a custom post type called Profile.
>
> Designer needs to have 1 ability and that's to edit a Profile post.
>
> I need to accomplish the following
>
>   - Create a custom Role called "Designer" - DONE
>   - I need to limit the capabilities of the Designer to ONLY edit their
>   Profile post.  I do not want them to be able to "Add Posts" of any type
>   because each Designer is only allowed one Profile Post
>   - On registration of a "designer" a custom post "Profile" is created and
>   published automatically with the new Designer set as the author
>   - The title of this new Profile will be the name of the Designer set by
>   the designer upon registration
>
>
> Problems I'm having
>
>   - It's easy enough to limit the capabilities of the new role to only
>   "edit posts" but that actually gives them access to the entire "Posts" admin
>   panel which include "add new"
>   - How do I define that they can ONLY edit a Custom Post Type rather than
>   a simple Post
>   - How do I auto create a custom post type upon registration of a new
>   user? I figure I can grab the hook that is used for a new user registration
>   and just add the post to the database manually.  If this is the best way of
>   doing it, I can don't need help with this.
>
> Jesse Friedman
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list