Skip Navigation

[Resolved] User Registration fields added to Custom Post Type

This support ticket is created 6 years, 4 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 14 replies, has 2 voices.

Last updated by Shane 6 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#1102540

Tell us what you are trying to do? I would like the data collected in the User Registration form I have created to populate to a Custom Post Type.

Is there any documentation that you are following? There was a support post from a few years ago (Populate custom post type fields with user fields upon user form submission.) Is the response still valid?

#1102613

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

Thank you for contacting our support forum.

Could you send me a link to the page to have a look ? I can let you know if this post is still valid.

Thanks,
Shane

#1102631

Can I send you the information privately? The site is under development at the moment.

#1102658

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

I was referring to the link to the forum post here , as you mentioned that you saw a solution but it was an old post ?

Thanks,
Shane

#1102670
#1104598

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

Yes this is still valid and you can follow the instructions that Luo provided in the ticket.

IF there are any queries you can just let me know and i'll be happy to assist.

Thanks,
Shane

#1107671

I have looked through the documentation but I am having some issues figuring out the code. Can you give me some sample code I can start with?

#1107760

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

Here is an example.

add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==12)
{
$cust_field1 = get_user_meta($post_id, 'wpcf-my-field');
$id = wp_insert_post(array('post_title'=>'random', 'post_type'=>'custom_post', 'post_content'=>'demo text'));
add_post_meta($id, 'wpcf-my-field', $cust_field1, true);
}
}
}


The above example gets the meta value from the my-field custom field, then creates a post and then update that post's custom field with the value stored in the $cust_field1 variable.

Please let me know if this example was clear for you.

Thanks,
Shane

#1109647

I am still struggling to get this to work. I have a User Form set up with the fields needed. I see your example but I am unsure of how to get it to work.

#1109653

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

Would you like if I set this up for you ?

For this I would need access to the website as well as what from the user form you would like to be created with the post.

Please let me know.

Thanks,
Shane

#1110799

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

Instead of having the user automatically created, why not allow them to create their profile after they created their user? Its a bit redundant to have the same info on the user and on the their profiles.

I would suggest this approach to maintain consistency. So if the user wants to change their info they can simply only change it one place instead of 2.

Please let me know what you think of this.

Thanks,
Shane

#1110801

What I need is for the Membership List to be searchable. There is a private Members area so the user needs to log in before viewing the Members area. An admin will add the member and edit their info, if necessary. What is the best approach?

#1110813

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

I would recommend taking a look at this documentation below.
https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

Thanks,
Shane

#1111590

This looks like it will work. Is there any way to have an administrator add the profile instead of the user?

#1111591

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lori,

The admin can create the profile but its a manual process. Then once its created then you will need to set the user as the author of that profile.

Thanks,
Shane