gravityflow_field_value_entry_editor

Description

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

ParameterTypeDetails
$valueStringThe current field value.
$fieldFieldThe current field.
$formFormThe current form.
$entryEntryThe current entry.
$stepStepThe current step.

Examples

Force application of default value with the New Entry Workflow step

1
2
3
4
5
6
7
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 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?