Skip Navigation

[Resolved] CRED User credentials to other site syncing

This thread is resolved. Here is a description of the problem and solution.

Problem:
Waldermar want to trigger his custom PHP function after the user is created by CRED form

Solution:
f you only need to trigger the action you mentioned above after the CRED form submitted, I suggest you try CRED action hook: cred_save_data

Also you can use WordPress build-in action hook user_register, which will be triggered in most cases(including CRED new user form), see document:
https://codex.wordpress.org/Plugin_API/Action_Reference/user_register
with the parameter $user_id, you can get the user_name of new user, function get_userdata()
$user_info = get_userdata(1);
$username = $user_info->user_login;

Relevant Documentation:
https://codex.wordpress.org/Function_Reference/get_userdata
https://toolset.com/documentation/user-guides/cred-api/#csd

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by waldemarW 6 years, 8 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#369307

I am trying to: Get user credentials from CRED and syncing it with our CRM programm.

Put into this array:

$user = array(
'username'=>'test2',
'email'=>'test@test.com',
'fio'=>'max mustermann',
'country'=>'germany',
'town'=>'berlin',
'tel'=>'123',
'fax'=>'321',
'skype'=>'john',
'magent'=>'msn',
'port'=>'bremerhaven',
'about'=>'no company',
'password'=>'qwerty');

And instead test2 as username i would like to get values from username filed from CRED and put it here 'username'=>'value_from_cred', and so on... What is the best method to do this?

Best Regards

Waldemar

#369525

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Dear Waldemar,

If you only need to trigger the action you mentioned above after the CRED form submitted, I suggest you try CRED action hook: cred_save_data
https://toolset.com/documentation/user-guides/cred-api/#csd

Also you can use WordPress build-in action hook user_register, which will be triggered in most cases(including CRED new user form), see document:
https://codex.wordpress.org/Plugin_API/Action_Reference/user_register
with the parameter $user_id, you can get the user_name of new user, function get_userdata()
$user_info = get_userdata(1);
$username = $user_info->user_login;
https://codex.wordpress.org/Function_Reference/get_userdata

#374652

Thanks for your support! It thanks a lot!