diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-22 09:48:56 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-22 09:48:56 +0000 |
| commit | c149beee65d00f2f2c4c82a0afb92379dc4ebea1 (patch) | |
| tree | 9958a166a000947b1fd04c18a23ed9e33f2638fa /wp-inst/wp-includes/capabilities.php | |
| parent | 9e49a3e6447829ea9bca3f477f2a0a65fcaf7ede (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@355 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/capabilities.php')
| -rw-r--r-- | wp-inst/wp-includes/capabilities.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wp-inst/wp-includes/capabilities.php b/wp-inst/wp-includes/capabilities.php index 1943689..e279ce4 100644 --- a/wp-inst/wp-includes/capabilities.php +++ b/wp-inst/wp-includes/capabilities.php @@ -22,7 +22,10 @@ class WP_Roles { } } - function add_role($role, $capabilities, $display_name) { + function add_role($role, $display_name, $capabilities = '') { + if ( isset($this->roles[$role]) ) + return; + $this->roles[$role] = array('name' => $display_name, 'capabilities' => $capabilities); update_option($this->role_key, $this->roles); @@ -41,7 +44,7 @@ class WP_Roles { update_option($this->role_key, $this->roles); } - function add_cap($role, $cap, $grant) { + function add_cap($role, $cap, $grant = true) { $this->roles[$role]['capabilities'][$cap] = $grant; update_option($this->role_key, $this->roles); } @@ -77,7 +80,7 @@ class WP_Role { $this->capabilities = $capabilities; } - function add_cap($cap, $grant) { + function add_cap($cap, $grant = true) { global $wp_roles; $this->capabilities[$cap] = $grant; |
