Home / Archive / WPForms: display a form under the confirmation message with or without user entered field values.
Duplicate Snippet

Embed Snippet on Your Site

WPForms: display a form under the confirmation message with or without user entered field values.

Code Preview
php
<?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
);

Comments

Add a Comment