Tell us what you are trying to do?
I have set up a series of forms to register CPT "Supplier"
The process is this:
User form > Post form to collect business details > Post form to collect a reference > Post form to collect second reference > Thank you page
My problem is that the "Post form to collect second reference" doesn't redirect to the thank you page after filling. Instead it shows itself again.
Things I have tried:
Switching off all non-Toolset plugins and reverting to theme Twenty-twenty-two – no difference
This morning though, I added this custom code to keep my user logged in while they completed the post forms:
add_action( 'cred_save_data', 'tssupp_cred_autologin', 10, 2 );
function tssupp_cred_autologin( $post_id, $form_data ){
if ( 2177 == $form_data['id'] ) { // Edit as required
if ( !empty( $_POST['user_login'] ) && !empty( $_POST['user_pass'] ) ) {
// get the user credentials from the $_POST object
$user = array(
'user_login' => $_POST['user_login'],
'user_password' => $_POST['user_pass'],
'remember' => true
);
$login = wp_signon( $user, false );
if ( is_wp_error($login) ) {
error_log( $login->get_error_message() );
}
}
}
}
Is it possible that I've got something wrong?
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site? This is the starting point for the flow (USER FORM): hidden link
This is the next POST form: hidden link
The next POST form: hidden link
And then this POST form: hidden link
Which should but doesn't go to this page: hidden link