Skip Navigation

[Résolu] create WordPress user with CRED

This support ticket is created Il y a 8 années et 4 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Marqué : 

This topic contains 6 réponses, has 2 voix.

Last updated by Dido Il y a 8 années et 3 mois.

Assisted by: Minesh.

Auteur
Publications
#353831

I have a short question, Is it possible to create WordPress users with CRED (and or Access)?

Second question: Is it possible to export results from CRED forms to .csv?

#353920

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

1) I have a short question, Is it possible to create WordPress users with CRED (and or Access)?
=> Yes, you can able to create WordPress user using CRED.

To create WordPress user on fly you can use wp_create_user when user submit the CRED form. You can catch the submit action of CRED form using "cred_save_data" hook.
=>https://toolset.com/documentation/user-guides/cred-api/

Please refer to the following link that may help you;
https://codex.wordpress.org/Function_Reference/wp_create_user

For example:

add_action('cred_save_data', 'creation_client',10,2);
function creation_client($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==1290)
{
if (isset($_POST['identifiant']))
{
$password = wp_generate_password( 10, true, false );
$userData = array(
'user_login' => $login,
'first_name' => $fname,
'last_name' => $lname,
'user_pass' => $password,
'user_email' => $_POST['email'],
'role' => 'Your-Role'
);
wp_insert_user( $userData );
}
}
}

2) Second question: Is it possible to export results from CRED forms to .csv?
It is possible but you will require custom code. For your custom code requirement you may contact our certified partners:
=> https://toolset.com/consultant/

#354134

Hi Minesh, Do I need to create a Custom Post for the Users? Or will they be added to the common users? (Or both?)

update: I found this usefull page:https://toolset.com/documentation/user-guides/cred-user-forms/

#354226

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ohh, yes, you are right. I thought you want to insert user using your custom CRED form.

Do I need to create a Custom Post for the Users? Or will they be added to the common users?
=> Its by default applied to the default users, no need to create new CPT for Users.

We just launched CRED USER forms. You should go with that. No need to write custom code I've provided before.
=> https://toolset.com/documentation/user-guides/cred-user-forms/

#355439

Hi, I have almost finished my job about the users, but I have two more questions.

1. How can I let them remove their own post.
2. How can I change the field type of the custom fields.

for instance: hidden link
Land must be single line

#355483

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

May I kindly ask you please to open a new ticket for your each new question? This will also help other users with similar problems find solutions when searching the forum.

Thank you for understanding.

#355544

Ok, I will do that.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.