user_has_cap

user_has_cap

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.5.2

do_action('user_has_cap') is found 1 times:

  • /wp-includes/class-wp-user.php line 813
    		 *     @type mixed  ...$2 Optional second and further parameters, typically object ID.
    		 * }
    		 * @param WP_User  $user    The user object.
    		 */
    		$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this );
    
    		// Everyone is allowed to exist.
    		$capabilities['exist'] = true;
    
    		// Nobody is allowed to do things they are not allowed to do.
    		unset( $capabilities['do_not_allow'] );
    

See this hook used in plugins: