Home › Forums › Toolset Professional Support › [Resolved] Get Auto-generate Username on cred_save_data
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Tagged: CRED API, Toolset Forms, User-registration forms
This topic contains 1 reply, has 2 voices.
Last updated by Waqar 5 months, 1 week ago.
Assigned support staff: Waqar.
Hi, I created a User Add form with Auto-generate Username. Then I need to get the Username on cred_save_data. I tried with
$user_login = $_POST['user_login'];, but it doesn't work.
can you help me?
English (English )
Thank you for contacting us and I'd be happy to assist.
Since the username is automatically generated, it is not available in the form's submitted data ($_POST).
To get it, you can use WordPress' "get_userdata" function.
( ref: https://developer.wordpress.org/reference/functions/get_userdata/ )
function user_form_data_action($post_id, $form_data)
$user_obj = get_userdata( $post_id );
$usernanme = $user_obj->user_login;
Note: you'll replace "1234" with the ID of your actual form.
I hope this helps and please let me know if you need any further assistance around this.
Known issues and solutions
Frequently asked support questions
Support tickets archive
Get help from experienced contractors
Meet Toolset support team
Toolset Customer Support Policy
Need to tell us something about the quality of support
How to remove personal information from your database for support