Description
The gform_ability_permission_denied action fires when a call is blocked due to a failed permission check, the connecting user lacks the required capability, the tool is disabled in settings, or submissions are blocked.
Usage
add_action( 'gform_ability_permission_denied', 'your_function_name', 10, 3 );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $ability_name | string | The name of the ability the caller was denied access to. |
| $input | array | The input parameters that were passed with the call. |
| $ability | object | The ability object the caller was denied access to. |
Examples
Log Denied Calls.
add_action( 'gform_ability_permission_denied', function ( $name ) {
GFCommon::log_error( "MCP permission denied: {$name}" );
} );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This action is located in gravityforms/includes/abilities/class-gf-ability.php
Since
The action was added in Gravity Forms 3.1.0