ACF\Site_Health
AI_Usage::log_execution
Log execution events (when agents execute ACF abilities).
Hooks into wp_after_execute_ability to log successful ability executions.
Method of the class: AI_Usage{}
No Hooks.
Returns
null. Nothing (null).
Usage
$AI_Usage = new AI_Usage(); $AI_Usage->log_execution( $ability_name, $input, $result );
- $ability_name(string) (required)
- The namespaced ability name.
- $input(mixed) (required)
- The input data passed to the ability.
- $result(mixed) (required)
- The result returned by the ability.
Changelog
| Since 6.8.0 | Introduced. |
AI_Usage::log_execution() AI Usage::log execution code ACF 6.8.8
public function log_execution( string $ability_name, $input, $result ) {
// Only log ACF abilities.
if ( strpos( $ability_name, 'acf/' ) !== 0 ) {
return;
}
$is_error = $result instanceof WP_Error;
$this->increment_execution_count( $ability_name, $is_error );
}