plugins - Disallow authors to editdelete their own or other published posts

I would like to have people write on my blog and i am ok with editing their own posts while on draft. However, once thei

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');

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742403868a4437451.html

相关推荐

  • plugins - Disallow authors to editdelete their own or other published posts

    I would like to have people write on my blog and i am ok with editing their own posts while on draft. However, once thei

    1天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信