/** * Force pricing fields to show in forms when filling out on Gravity Flow pages. * * If `$_GET['view'] == 'entry'`, Gravity Forms will show "Pricing fields are not editable." * See \GPNF_GravityFlow::enable_editing_pricing_field in gp-nested-forms/includes/class-gpnf-gravityflow.php line 220 * * @param string $input Input tag string. * @param \GP_Nested_Form_Field $field Current field object. * @param string $value Pre-populated value. * @param int $entry_id Current entry id. * @param int $form_id Current form id. * * @return string */ add_filter( 'gform_field_input', function ( $input, $field, $value, $entry_id, $form_id ) { // Only process if no input has been set yet and we're in entry view if ( ! empty( $input ) || rgget( 'view' ) !== 'entry' ) { return $input; } // Only apply to your specific workflow form(s) $workflow_form_ids = [ 5 ]; if ( ! in_array( intval( $form_id ), $workflow_form_ids, true ) ) { return $input; } // Only process if this is a Gravity Flow context if ( rgget( 'page' ) !== 'gravityflow-inbox' ) { return $input; } // Override pricing field restriction if ( GFCommon::is_pricing_field( $field->type ) ) { $form = GFAPI::get_form( $form_id ); $entry = $entry_id ? GFAPI::get_entry( $entry_id ) : null; // Return the actual field input instead of the "not editable" message return $field->get_field_input( $form, $value, $entry ); } return $input; }, 10, 5 );