gform_ability_permission_denied

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

ParameterTypeDescription
$ability_namestringThe name of the ability the caller was denied access to.
$inputarrayThe input parameters that were passed with the call.
$abilityobjectThe 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