Created
February 22, 2021 15:24
-
-
Save slaFFik/6ff289cd9fa53b7c0ad8a221eb593d11 to your computer and use it in GitHub Desktop.
WPForms: display a form under the confirmation message with or without user entered field values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( | |
'wpforms_frontend_output_success', | |
static function ( $form_data, $fields, $entry_id ) { | |
unset( | |
$_GET['wpforms_return'], | |
$_POST['wpforms']['id'] | |
); | |
// If you want to preserve the user entered values in form fields - remove the line below. | |
unset( $_POST['wpforms']['fields'] ); | |
// Actually render the form. | |
wpforms()->frontend->output( $form_data['id'] ); | |
}, | |
42, | |
3 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment