Changeset 35935
- Timestamp:
- 12/14/2015 08:04:39 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-role.php
r34412 r35935 82 82 83 83 /** 84 * Whether role hascapability.84 * Determines whether the role has the given capability. 85 85 * 86 * The capabilities is passed through the 'role_has_cap' filter. The first87 * parameter for the hook is the list of capabilities the class has88 * assigned. The second parameter is the capability name to look for. The89 * third and final parameter for the hook is the role name.86 * The capabilities is passed through the {@see 'role_has_cap'} filter. 87 * The first parameter for the hook is the list of capabilities the class 88 * has assigned. The second parameter is the capability name to look for. 89 * The third and final parameter for the hook is the role name. 90 90 * 91 91 * @since 2.0.0 … … 93 93 * 94 94 * @param string $cap Capability name. 95 * @return bool True , if user has capability. False, if doesn't have capability.95 * @return bool True if the role has the given capability. False otherwise. 96 96 */ 97 97 public function has_cap( $cap ) { … … 106 106 */ 107 107 $capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name ); 108 108 109 if ( !empty( $capabilities[$cap] ) ) 109 110 return $capabilities[$cap];
Note: See TracChangeset
for help on using the changeset viewer.