From 4a4598bbdbe2e60ece1a7078bf96bc71e513b731 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 30 Nov 2005 20:04:04 +0000 Subject: [PATCH] add_role() and remove_role() convenience wrappers around git-svn-id: https://develop.svn.wordpress.org/trunk@3249 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 a3ac04f5cd..b64379ca8d 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(). //