[wp-hackers] Custom Role and Custom Post Types

SWORD Studios info at swordstudios.net
Sun Feb 13 13:42:44 UTC 2011


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


More information about the wp-hackers mailing list