WordPress自定义文章类型 控制用户组使用权限

%title插图%num

自定义的文章类型默认权限耿跟随WordPress的权限使用,即贡献者(有发布文章权限)默认也可以使用,如部分自定义权限如果只要求管理员可用。在自定义文章类型做如下配置:

'capabilities' => array(  
'edit_post' => 'administrator',   
'edit_posts' => 'administrator',   
'edit_others_posts' => 'administrator',   
'publish_posts' => 'administrator',   
'read_post' => 'administrator',   
'read_private_posts' => 'administrator',   
'delete_post' => 'administrator',   
    )  ,

插入位置参考

%title插图%num

实现效果

%title插图%num

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 共2条

请登录后发表评论

    • 头像李英杰0