Description
Filter the value of dynamically populated inputs and fields.
Usage
Apply to all forms.
add_filter( 'gppa_get_input_values', 'my_custom_function' );
Apply to a specific form.
add_filter( 'gppa_get_input_values_FORMID', 'my_custom_function' );
Apply to a specific field on a specific form.
add_filter( 'gppa_get_input_values_FORMID_FIELDID', 'my_custom_function' );
Parameters
$value string
Value of field.
$field GF_Field
Current field.
$template string
Parsed template value.
-
The objects that the query is pulling from.
Examples
Populate All Query Results As Comma-delimited List
<?php
/**
* Gravity Perks // Populate Anything // Populate All Query Results As Comma-delimited List
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*/
// Replace "123" with your form ID and "4" with your field ID.
add_filter( 'gppa_get_input_values_123_4', function ( $value, $field, $template, $objects ) {
$processed_values = array();
foreach ( $objects as $object ) {
$processed_values[] = gp_populate_anything()->process_template( $field, $template, $object, 'values', $objects );
}
return implode( ',', $processed_values );
}, 10, 4 );
Since
This filter is available since GF Populate Anything 1.0-beta-4.16.