Description
The gform_before_execute_ability action fires just before a tool runs (permission check already passed) which can’t block or change anything.
Usage
add_action( 'gform_before_execute_ability', 'your_function_name', 10, 3 );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $ability_name | string | The name of the ability about to be executed. |
| $input | array | The input parameters being passed to the ability. |
| $ability | object | The ability object about to be executed. |
Examples
Log ability execution.
add_action( 'gform_before_execute_ability', function ( $ability_name, $input, $ability ) {
// Log every ability that passes the permission check.
GFCommon::log_debug( "Executing ability: {$ability_name}" );
// Optional: react only when a specific ability runs.
if ( 'gravityforms/entries-delete' === $ability_name ) {
GFCommon::log_debug(
sprintf(
'About to delete entry ID %s',
rgar( $input, 'entry_id' )
)
);
}
}, 10, 3 );
Source Code
This action is located in gravityforms/includes/abilities/class-gf-ability.php
Since
The action was added in