Changeset 33967
- Timestamp:
- 09/09/2015 03:41:27 AM (9 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities-functions.php
r33752 r33967 472 472 */ 473 473 function add_role( $role, $display_name, $capabilities = array() ) { 474 if ( empty( $role ) ) { 475 return; 476 } 474 477 return wp_roles()->add_role( $role, $display_name, $capabilities ); 475 478 } -
trunk/src/wp-includes/class-wp-roles.php
r33752 r33967 173 173 */ 174 174 public function add_role( $role, $display_name, $capabilities = array() ) { 175 if ( isset( $this->roles[$role] ) ) 176 return; 175 if ( empty( $role ) || isset( $this->roles[ $role ] ) ) { 176 return; 177 } 177 178 178 179 $this->roles[$role] = array( -
trunk/src/wp-includes/class-wp-user.php
r33958 r33967 440 440 */ 441 441 public function add_role( $role ) { 442 if ( empty( $role ) ) { 443 return; 444 } 445 442 446 $this->caps[$role] = true; 443 447 update_user_meta( $this->ID, $this->cap_key, $this->caps );
Note: See TracChangeset
for help on using the changeset viewer.