public function filter_user_has_cap( array $user_caps, array $required_caps, array $args, WP_User $user ) {
		if ( 'view_query_monitor' !== $args[0] ) {
			return $user_caps;
		}

		if ( array_key_exists( 'view_query_monitor', $user_caps ) ) {
			return $user_caps;
		}

		if ( ! is_multisite() && user_can( $args[1], 'manage_options' ) ) {
			$user_caps['view_query_monitor'] = true;
		}

		return $user_caps;
	}
public function filter_user_has_cap( array $user_caps, array $required_caps, array $args, WP_User $user ) {
		if ( 'view_query_monitor' !== $args[0] ) {
			return $user_caps;
		}

		if ( array_key_exists( 'view_query_monitor', $user_caps ) ) {
			return $user_caps;
		}

		if ( ! is_multisite() && user_can( $args[1], 'manage_options' ) ) {
			$user_caps['view_query_monitor'] = true;
		}

		return $user_caps;
	}
public function filter_user_has_cap ( array $ user_caps , array $ required_caps , array $ args , WP_User $ user ) { if ( 'view_query_monitor' !== $ args [ 0 ] ) { return $ user_caps ; } if ( array_key_exists ( 'view_query_monitor' , $ user_caps ) ) { return $ user_caps ; } if ( ! is_multisite ( ) && user_can ( $ args [ 1 ] , 'manage_options' ) ) { $ user_caps [ 'view_query_monitor' ] = true ; } return $ user_caps ; }
Filter a user's capabilities so they can be altered at runtime.

This is used to:
- Grant the 'view_query_monitor' capability to the user if they have the ability to manage options.

This does not get called for Super Admins.

@param bool[]   $user_caps     Array of key/value pairs where keys represent a capability name and boolean values
represent whether the user has that capability.
@param string[] $required_caps Required primitive capabilities for the requested capability.
@param array    $args {
Arguments that accompany the requested capability check.

@type string    $0 Requested capability.
@type int       $1 Concerned user ID.
@type mixed  ...$2 Optional second and further parameters.
}
@param WP_User  $user          Concerned user object.
@return bool[] Concerned user's capabilities.
Filter a user s capabilities so they can be altered at runtime .