你好,添加角色 添加以下代码至 Functions.php:
$result = add_role(
'basic_contributor',
__( '新订阅者' ),
array(
'read' => true, // 允许阅读文章
'edit_posts' => true, // 允许修改文章
'delete_posts' => false, // 不允许删除文章,以此类推
)
);
if ( null !== $result ) {
echo 'Yay! New role created!';
}
else {
echo 'Oh... the basic_contributor role already exists.';
}
当然,添加一种新的角色也不是难事,“版主”、“专栏作者”……只有想不到,没有做不到~