最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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');
发布评论

评论列表(0)

  1. 暂无评论