Skip Navigation

[Resolved] User profile page via CRED

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

Problem: I would like to associate a post created by CRED with the current User.

Solution: Use a custom field on the post and insert the current User's ID using the wpv-current-user shortcode:

<div style="display:none;">
[cred_field field='user-id' post='post' value='[wpv-current-user info="id"]' urlparam='' class='form-control' output='bootstrap']
</div>

Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-current-user

This support ticket is created 7 years 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.

Our next available supporter will start replying to tickets in about 0.37 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#577941

Hi

I have a CRED-form to make a paid account. I want to make a second CRED-form wherein the user can make (and later edit) a special user-profile page.
So the two CRED forms need to be connected via the user-ID and the two fields: First-name and Last-name need to be the title of the post.

How to make this connection? I can’t figure it out.

Is there any documentation that you are following? Can't find a good one.

Is there a similar example that we can see? Just a profile page with photo, Name, Adress, Text, Specialities, etc.

What is the link to your site? hidden link

Thanks,
Charlotte

#577963

So the two CRED forms need to be connected via the user-ID and the two fields: First-name and Last-name need to be the title of the post.
Hi, it sounds like you need a way to capture the current User's ID, first and last names, and store those in a new post in a custom post type. One way to do this is to create a custom field on the post type that will store the User's ID. Let's call that post type "Profile" and call the field "user-id" for simplicity. When you auto-generate this form in the CRED form wizard, the user-id field will be included in the inputs. However, you don't need to show this to your users so we can hide it with CSS. In the default value of the custom field, we will place the Current User's ID with a shortcode. Example:

<div style="display:none;">
[cred_field field='user-id' post='post' value='[wpv-current-user info="id"]' urlparam='' class='form-control' output='bootstrap']
</div>

Similarly, we can place the Current User's first and last names in the default value of the title field. If you don't want your User to edit this, again we can hide it with CSS.

<div style="display:none;">
[cred_field field='post_title' post='post' value='[wpv-current-user info="firstname"] [wpv-current-user info="lastname"]' urlparam='' class='form-control' output='bootstrap']
</div>

Now when the User submits this form, CRED will automatically add the current User's ID in the custom field, and will automatically set the title based on the current User's first and last names. Let me know if you have questions about that.

#578914

I didn't realise the meaning of 'wpv-current-user'. It resolves my issue.
Thanks!