admin管理员组

文章数量:1122832

I have some custom user roles for proofreaders which do not have the capability to create posts of my custom post types.

Unfortunately I am unable to find out how to remove that capability for the bulit-in post post type.

The Members plugin does not show the create_post argument, so I can't set it do deny (false).

Thanks for your help.

I have some custom user roles for proofreaders which do not have the capability to create posts of my custom post types.

Unfortunately I am unable to find out how to remove that capability for the bulit-in post post type.

The Members plugin does not show the create_post argument, so I can't set it do deny (false).

Thanks for your help.

Share Improve this question asked Oct 3, 2016 at 10:21 SamSam 4356 silver badges18 bronze badges 2
  • Do you want to prevent them editing existing posts and deleting posts too? – Andy Macaulay-Brook Commented Oct 3, 2016 at 10:54
  • @AndyMacaulay-Brook They should be able to edit them (correct errors), but they should not be able to delete them, yes! – Sam Commented Oct 3, 2016 at 11:21
Add a comment  | 

1 Answer 1

Reset to default 0

There is no built-in capability of create_post.

Update: There is a capability create_posts but it's not well publicised and also has issues surrounding it which I'm afraid I don't have time to look into at the moment.

There are already answers that might help:

https://stackoverflow.com/a/3248103

https://wordpress.stackexchange.com/a/178059/94267


Original answer:

There is publish_posts. You need to turn this off for those users. Removing this capability doesn't prevent a user or role from writing a draft post, but it does prevent them from publishing it, so it won't be seen outside the admin.

Currently (WP 4.6) posts have these capabilities associated with them:

edit_posts
edit_others_posts
publish_posts
read_private_posts  
delete_posts
delete_private_posts
delete_published_posts
delete_others_posts
edit_private_posts
edit_published_posts

You probably want to disallow the *_private_* capabilities for anyone but Admins too.

本文标签: user rolesDisable createpost for builtin post type