diff --git wp-includes/capabilities.php wp-includes/capabilities.php
index 6a7b021..3fdb66b 100644
|
|
|
class WP_Roles { |
| 163 | 163 | function add_role( $role, $display_name, $capabilities = array() ) { |
| 164 | 164 | if ( isset( $this->roles[$role] ) ) |
| 165 | 165 | return; |
| | 166 | |
| | 167 | if( empty( $role ) ) |
| | 168 | return; |
| 166 | 169 | |
| 167 | 170 | $this->roles[$role] = array( |
| 168 | 171 | 'name' => $display_name, |
| … |
… |
class WP_User { |
| 761 | 764 | * @param string $role Role name. |
| 762 | 765 | */ |
| 763 | 766 | function add_role( $role ) { |
| | 767 | |
| | 768 | if( empty( $role ) ) |
| | 769 | return; |
| | 770 | |
| 764 | 771 | $this->caps[$role] = true; |
| 765 | 772 | update_user_meta( $this->ID, $this->cap_key, $this->caps ); |
| 766 | 773 | $this->get_role_caps(); |
| … |
… |
function get_role( $role ) { |
| 1397 | 1404 | function add_role( $role, $display_name, $capabilities = array() ) { |
| 1398 | 1405 | global $wp_roles; |
| 1399 | 1406 | |
| | 1407 | if( empty( $role ) ) |
| | 1408 | return; |
| | 1409 | |
| 1400 | 1410 | if ( ! isset( $wp_roles ) ) |
| 1401 | 1411 | $wp_roles = new WP_Roles(); |
| 1402 | 1412 | |