I am trying to: Automatically log in a user like this post: https://toolset.com/forums/topic/automatically-log-in-user-after-created/
Link to a page where the issue can be seen: hidden link
When the form is submitted the post variables must be getting purged or destroyed before the hook runs with the function from this URL: https://toolset.com/forums/topic/automatically-log-in-user-after-created/ can be run.
We created a plugin to dump the $_POST variables (as a test) and nothing is returned from the Toolset User Form. But if we create our own simple form (as seen on the test URL) and post the variables in that then we can output the $_POST variables. It's like Toolset is removing the $_POST variables before they can be grabbed and entered into the function which automatically logs in the user.
Hi,
How do you setup the Toolset form for creating user?
Can you take a screenshot for it?
And in case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test your custom PHP codes again.
I can give you login info, how can I submit it?
Have you tried as I mentioned above?
And in case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test your custom PHP codes again.
Can you confirm the compatibility problem?
If there isn't compatibility problem, please provide your website database dump file, also point out the problem page URL and form URL, I need to test it in my localhost. thanks
We have tested with all plugins disabled and the error is still there. But you will need the theme files to test this. You can log into the Admin of the development site and download the fresh copy of a Duplicator file I just created.
Link to a page where the issue can be seen: hidden link
I have enabled the "private detail box" again, you can put your database dump file in your own google drive disk, and share the link in below private detail box, thanks
Did you do anything on the production site that would stop the jonroc-design-center plugin from registraring a template file? I was working on the site last night and everything was fine and today the templates in the plugin are not loading.
Thanks for the details, I have added below codes in your theme file "functions.php":
add_action( 'cred_save_data', 'tssupp_cred_autologin', 10, 2 );
function tssupp_cred_autologin( $post_id, $form_data ){
if ( 18236 == $form_data['id'] ) { // Edit as required
var_dump($_POST);
die();
}
}
Test it in front-end:
hidden link
It works fine, does output the value of variable $_POST, see screenshot post.JPG
It is only a demo for your reference, I suggest you follow our document to use action hook cred_save_data:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
For your new question:
do anything on the production site that would stop the jonroc-design-center plugin from registraring a template file?
It is out the range of Toolset support, I suggest you check it with author of the jonroc-design-center plugin
That's so strange, we still can't get the post info to come into the function. It's too bad Toolset does not allow an autologin automatically from its form as this is a common need.
My issue still exists but don't have any more time to try and troubleshoot.