AI Summary
Description
The wpforms_process_before_form_data
filter lets you modify form data during processing, before WPForms continues saving or validating the submission. This can be used to adjust settings, add dynamic values, or modify payment descriptions.
This filter runs early in the form process, right after WPForms decodes the form content. Developers can use it to customize form behavior, update payment data, or add context-specific values.
parameter | type | description |
---|---|---|
$form_data | array | Form ID |
$entry | array | The raw entry data submitted. |
Source
wpforms\includes\class-process.php
Example
// Append the current page title to the Stripe payment description.
function wpf_dev_process_form_data( $form_data, $entry ) {
if ( isset( $form_data['payments']['stripe']['payment_description'] ) ) {
$form_data['payments']['stripe']['payment_description'] .= ' - ' . get_the_title();
}
return $form_data;
}
add_filter( 'wpforms_process_before_form_data', 'wpf_dev_process_form_data', 10, 2 );