add_role() and remove_role() convenience wrappers around

git-svn-id: http://svn.automattic.com/wordpress/trunk@3249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-11-30 20:04:04 +00:00
parent a2997ccd6a
commit ec4e918588
1 changed files with 13 additions and 1 deletions

View File

@ -280,13 +280,25 @@ function current_user_can($capability) {
return call_user_func_array(array(&$current_user, 'has_cap'), $args);
}
// Convenience wrapper around $wp_roles.
// Convenience wrappers around $wp_roles.
function get_role($role) {
global $wp_roles;
return $wp_roles->get_role($role);
}
function add_role($role, $display_name, $capabilities = '') {
global $wp_roles;
return $wp_roles->add_role($role, $display_name, $capabilities = '');
}
function remove_role($role) {
global $wp_roles;
return $wp_roles->remove_role($role);
}
//
// These are deprecated. Use current_user_can().
//