Codex tools: Log in
Contents |
Adds a capability to a role.
<?php add_cap( $role, $cap, $grant ); ?>
function add_theme_caps() {
$role = get_role( 'author' ); // gets the author role
$role->add_cap( 'edit_others_posts' ); // would allow the author to edit others' posts for current theme only
}
add_action( 'admin_init', 'add_theme_caps');
add_cap is located in wp-includes/capabilities.php.
Roles and Capabilities: add_role(), remove_role(), get_role(), add_cap(), remove_cap()