From ec4e918588b16da4c968962ee3cc6a35d3642c23 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 30 Nov 2005 20:04:04 +0000 Subject: [PATCH] add_role() and remove_role() convenience wrappers around git-svn-id: http://svn.automattic.com/wordpress/trunk@3249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index a3ac04f5c..b64379ca8 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -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(). //