add_role() and remove_role() convenience wrappers around
git-svn-id: https://develop.svn.wordpress.org/trunk@3249 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
493c8b626f
commit
4a4598bbdb
@ -280,13 +280,25 @@ function current_user_can($capability) {
|
|||||||
return call_user_func_array(array(&$current_user, 'has_cap'), $args);
|
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) {
|
function get_role($role) {
|
||||||
global $wp_roles;
|
global $wp_roles;
|
||||||
|
|
||||||
return $wp_roles->get_role($role);
|
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().
|
// These are deprecated. Use current_user_can().
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user