Title: wp_ai_client_{$event_name}
Published: May 20, 2026

---

# do_action( “wp_ai_client_{$event_name}”, object $event )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#changelog)

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

Fires when an AI client event is dispatched.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#description)󠁿

The dynamic portion of the hook name, `$event_name`, refers to the snake_case version
of the event class name, without the `_event` suffix.

For example, an event class named `BeforeGenerateResultEvent` will fire the `wp_ai_client_before_generate_result`
action hook.

In practice, the available action hook names are:

 * wp_ai_client_before_generate_result
 * wp_ai_client_after_generate_result

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

 `$event`object

The event object.

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

    ```php
    do_action( "wp_ai_client_{$event_name}", $event );
    ```

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

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_AI_Client_Event_Dispatcher::dispatch()](https://developer.wordpress.org/reference/classes/wp_ai_client_event_dispatcher/dispatch/)`wp-includes/ai-client/adapters/class-wp-ai-client-event-dispatcher.php` |

Dispatches an event to WordPress action hooks.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_ai_client_event_name/?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%2Fhooks%2Fwp_ai_client_event_name%2F)
before being able to contribute a note or feedback.