Codex tools: Log in
Contents |
Removes a capability from a role.
<?php remove_cap( $role, $cap ); ?>
add_action( 'admin_init', 'remove_editor_read_private_posts' );
function remove_editor_read_private_posts(){
global $wp_roles;
$wp_roles->remove_cap( 'editor', 'read_private_posts' );
}
NB: This setting is saved to the database, so it might be better to run this on theme/plugin activation (and then undo on de-activation)?
remove_cap() is located in wp-includes/capabilities.php.
Roles and Capabilities: add_role(), remove_role(), get_role(), add_cap(), remove_cap()