WPForms: display a form under the confirmation message with or without user entered field values.
This file contains 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