您描述的角色是“贡献者”。因此,除非您仍想编辑作者功能,否则可以选择使用此角色,具体操作如下:
function disable_authors_publish_cap() {
// Get author role object
$author = get_role( \'author\' );
// Remove the post publishing capability
$author->remove_cap( \'publish_posts\' );
}
add_action( \'init\', \'disable_authors_publish_cap\' );
此外,如果您希望作者和贡献者具有完全相同的功能,那么还有一些功能需要“删除”:
function disable_authors_caps() {
// Get author role object
$author = get_role( \'author\' );
// List the author vs contributor capabilities
$caps = array(
\'edit_published_posts\',
\'upload_files\',
\'publish_posts\',
\'delete_published_posts\'
);
foreach ( $caps as $cap ) {
// Remove the capability.
$author->remove_cap( $cap );
}
}
add_action( \'init\', \'disable_authors_caps\' );
祝你好运!