admin管理员组

文章数量:1336131

I would like to have people write on my blog and i am ok with editing their own posts while on draft. However, once their posts are published, I wouldn't like them to be able to edit/delete any published posts, not even the owned that they have written.

Is there a way to do that ?

I would like to have people write on my blog and i am ok with editing their own posts while on draft. However, once their posts are published, I wouldn't like them to be able to edit/delete any published posts, not even the owned that they have written.

Is there a way to do that ?

Share Improve this question asked Nov 13, 2012 at 20:44 SpyrosPSpyrosP 5152 gold badges10 silver badges23 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 4

Downgrade tham to Contributors user role.

Add this code to your functions.php file or just use Snippet plugins to add it to your WP site. If you don't know about how to use this kind of code just search a bit.

function wpb_change_author_role(){
    global $wp_roles;
    $wp_roles->remove_cap( 'author', 'delete_posts' );
    $wp_roles->remove_cap( 'author', 'delete_published_posts' );
    $wp_roles->remove_cap( 'author', 'publish_posts' );
    $wp_roles->remove_cap( 'author', 'edit_published_posts' );
    #$wp_roles->remove_cap( 'author', 'edit_posts' );
}
add_action('init', 'wpb_change_author_role');

本文标签: pluginsDisallow authors to editdelete their own or other published posts