3

Im just wondering if its possible to create user role that allows to write/edit custom post type for example: Consultants, but not allow to write normal posts (used for as news for example).

I know that if user wants to edit posts its a must to have edit_post enabled for him. Question is if i can create something like: edit_[custom_post_type] or something?

Thanks in avance if anyone can help me with this issue...

Kindest regards

2 Answers 2

1

I suspect that Justin Tadlock's Members Plugin would make this very easy for you.

1
  • Yes was about to write this. That figures out all my problems :D. Thanks anyway!
    – kroma
    Commented Jun 13, 2011 at 13:24
1

When you register your custom post type, explicitly set the capability type;

register_post_type( 'my_type',  array(
    'capability_type' => 'my_type',
    // other args
) );

Now by default, only super admins should be able to add/edit/delete them, until you grant other roles the relevant capabilities (for example, as @tnorthcutt suggested, using the Members Plugin).

[edit_post] => edit_my_type
[read_post] => read_my_type
[delete_post] => delete_my_type
[edit_posts] => edit_my_type
[edit_others_posts] => edit_others_my_type
[publish_posts] => publish_my_type
[read_private_posts] => read_private_my_type

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.