redirect after form submit wordpress code example
Example: wpforms redirect after submit
/*functions.php
* Return a specific URL on form submit.
*
* @link https://wpforms.com/developers/how-to-customize-the-form-action/
*
*/
function wpf_custom_form_action( $action, $form_data ) {
if ( $form_data['id'] == '25' ) {
return 'https://www.somesite.com';
}
return $action;
}
add_filter( 'wpforms_frontend_form_action', 'wpf_custom_form_action', 10, 2 );