Step 1
Create a new form with just the default submit button.
Go to Edit Form → Settings → General and turn off the Save submitted form data option.
Go to Edit Form → Settings → Style → Buttons and at the Submit button text enter the text for the submit button e.g. Logout
.
Go to Edit Form → Settings → Notifications and delete the Admin notification.
Go to Edit Form → Settings → Confirmations and go to the settings for the Default confirmation then at the Type option choose Reload the page, or choose Redirect to another page then choose a page to redirect to.
Step 2
Add the following code to the WordPress theme functions.php file (or create a plugin for it).
12
3
4
5
| add_filter('quform_post_validate_1', function (array $result) { wp_logout(); return $result; }); |
add_filter('quform_post_validate_1', function (array $result) { wp_logout(); return $result; });
- On line 1, replace the number
1
with the form ID
1
2
3
4
5
6
7 | function my_user_logout(array $result) { wp_logout(); return $result; } add_filter('quform_post_validate_1', 'my_user_logout'); |
function my_user_logout(array $result) { wp_logout(); return $result; } add_filter('quform_post_validate_1', 'my_user_logout');
- On line 7, replace the number
1
with the form ID