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
Include all query results in value as comma-delimited list
This example shows how you can use all returned objects from the query and put them into a comma-delimited list.
add_filter( 'gppa_get_input_values_FORMID_FIELDID', 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.