gform_abilities_log_safe_input_keys

Description

The gform_abilities_log_safe_input_keys filter lets add-ons with their own identifier inputs extend that list.

Note: The built-in abilities log redacts input values by default; only an allowlist of identifier-style keys (form_id, entry_id, etc.) is written verbatim, and everything else logs as [redacted]. Never add keys that can carry user-submitted content.

Usage

The following would apply to all abilities.

add_filter( 'gform_abilities_log_safe_input_keys', 'your_function_name' );

Parameters

ParameterTypeDescription
$safe_input_keysstringThe allowlist of input keys that are logged verbatim. All other input keys are redacted.

Examples

Log a Custom Identifier Key.

add_filter( 'gform_abilities_log_safe_input_keys', function ( $keys ) {
	$keys[] = 'subscriber_id';
	return $keys;
} );

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 filter is located in gravityforms/includes/abilities/class-gf-abilities-logger.php

Since

The filter was added in Gravity Forms 3.1.0