gravityflow_field_value_entry_editor
The gravityflow_field_value_entry_editor filter determines if the current field is an editable Nested Form field so the required functionality can be included.
Parameters
Parameter | Type | Definition |
---|---|---|
$value | mixed | The current field value. |
$field | GF_Field | The current field. |
$form | Array | The parent form. |
$entry | Array | The parent entry. |
$step | Gravity_Flow_Step | The current step for the parent entry. |
Examples
Example 1 - Force application of default value with the New Entry Workflow step
add_filter( 'gravityflow_field_value_entry_editor', function ( $value, $field, $form, $entry, $step ) { $is_current_step_submission = ! empty( $_POST ) && rgpost( 'gravityflow_submit' ) == $form['id'] && rgpost( 'step_id' ) == $step->get_id(); if ( ! $is_current_step_submission ) { $value = $field->get_value_default_if_empty( $value ); } return $value; }, 10, 5 );
Placement
This code should be placed in the functions.php file of your active theme or in a custom functions plugin.