Changeset 42343 for trunk/src/wp-includes/class-wp-role.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-role.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-role.php
r41162 r42343 42 42 */ 43 43 public function __construct( $role, $capabilities ) { 44 $this->name = $role;44 $this->name = $role; 45 45 $this->capabilities = $capabilities; 46 46 } … … 55 55 */ 56 56 public function add_cap( $cap, $grant = true ) { 57 $this->capabilities[ $cap] = $grant;57 $this->capabilities[ $cap ] = $grant; 58 58 wp_roles()->add_cap( $this->name, $cap, $grant ); 59 59 } … … 72 72 */ 73 73 public function remove_cap( $cap ) { 74 unset( $this->capabilities[ $cap] );74 unset( $this->capabilities[ $cap ] ); 75 75 wp_roles()->remove_cap( $this->name, $cap ); 76 76 } … … 101 101 $capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name ); 102 102 103 if ( ! empty( $capabilities[$cap] ) )104 return $capabilities[ $cap];105 else103 if ( ! empty( $capabilities[ $cap ] ) ) { 104 return $capabilities[ $cap ]; 105 } else { 106 106 return false; 107 } 107 108 } 108 109
Note: See TracChangeset
for help on using the changeset viewer.