Title: WP_AI_Client_Ability_Function_Resolver::__construct
Published: May 20, 2026

---

# WP_AI_Client_Ability_Function_Resolver::__construct( WP_Ability|string $abilities )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#parameters)󠁿

 `$abilities`[WP_Ability](https://developer.wordpress.org/reference/classes/wp_ability/)
|stringrequired

The abilities that this resolver is allowed to execute.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct( ...$abilities ) {
    	$this->allowed_abilities = array();

    	foreach ( $abilities as $ability ) {
    		if ( $ability instanceof WP_Ability ) {
    			$this->allowed_abilities[ $ability->get_name() ] = true;
    		} elseif ( is_string( $ability ) ) {
    			$this->allowed_abilities[ $ability ] = true;
    		}
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ai-client/class-wp-ai-client-ability-function-resolver.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/ai-client/class-wp-ai-client-ability-function-resolver.php#L52)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/ai-client/class-wp-ai-client-ability-function-resolver.php#L52-L62)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_ai_client_ability_function_resolver/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.0.0](https://developer.wordpress.org/reference/since/7.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_ai_client_ability_function_resolver%2F__construct%2F)
before being able to contribute a note or feedback.