summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/capabilities.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-12-01 15:28:34 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-12-01 15:28:34 +0000
commitca460de5458e35b012e643b2af4880312c06d0f6 (patch)
treeebe8e430f2a863ae7b6671ea3e51ff1eaee0bb7a /wp-inst/wp-includes/capabilities.php
parent814b39931c8ff188122ba77b78388b4fbe7008df (diff)
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@454 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/capabilities.php')
-rw-r--r--wp-inst/wp-includes/capabilities.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/wp-inst/wp-includes/capabilities.php b/wp-inst/wp-includes/capabilities.php
index 602a97f..b4dfc0b 100644
--- a/wp-inst/wp-includes/capabilities.php
+++ b/wp-inst/wp-includes/capabilities.php
@@ -26,8 +26,9 @@ class WP_Roles {
if ( isset($this->roles[$role]) )
return;
- $this->roles[$role] = array('name' => $display_name,
- 'capabilities' => $capabilities);
+ $this->roles[$role] = array(
+ 'name' => $display_name,
+ 'capabilities' => $capabilities);
update_option($this->role_key, $this->roles);
$this->role_objects[$role] = new WP_Role($role, $capabilities);
$this->role_names[$role] = $display_name;
@@ -280,13 +281,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().
//