Description

The wpforms_entry_save_data filters the entry data before saving the entry.

Parameters

$fields
(array) Unsanitized field data.
$entry
(array) Entry data.
$form_data
(array) Processed form settings/data, prepared to be used later.

Source

wpforms/src/Forms/Submission.php

More Information

This filter will provide users with the ability to manipulate the entry data prior to saving the entry.

Examples

In this example, we’re going to exclude a few fields from the entry.

function exclude_fields_from_entries( $fields, $entry, $form_data ) {

$exclude_field_ids = array( 13, 25, 28 );

foreach ( $fields as $key => $field ) {

    if ( in_array( $field[ 'id' ], $exclude_field_ids ) ) {

        unset( $fields[ $key ] );

    }
}

return $fields;

}
add_filter( 'wpforms_entry_save_data', 'exclude_fields_from_entries', 10, 3 );