Skip Navigation

[Résolu] CRED input form with user field used as default values – not working for me

This support ticket is created Il y a 7 années et 10 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
- 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)

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

Last updated by tony Il y a 7 années et 10 mois.

Assisted by: Luo Yang.

Auteur
Publications
#394295

I am trying to: set up a cred form with pre-entered user fields for users that are logged in.

I registered some additional user fields for "organisation" and "phone" and then set up a CRED enquiry post form that pre-set the values:

<div class="cred-field cred-field-enquiry-organisation">
<label class="cred-label">Organisation</label>
[cred_field field='enquiry-organisation' post='sales-enquiry' value='[types usermeta="greenprint-client-organisation" user_is_author="true"][/types]' urlparam='']
</div>

A site user that is not logged in should not see the pre-set values but the form is displaying the data that relates to the first registered user.

Also, if I log in as a second user, I expect to see my values and not those belonging to user 1.

Is this a bug or am I missing something?

Here is a test URL
hidden link

When you display the home page, the form can be seen with incorrect data showing.

Note that the basic user fields display correctly. It is only the additional user fields that don't display as they should.

Thanks.
Tony

#394462

Dear Tony,

I assume the first user of your website is the first registered user, who created the front-page, as you can see in your shortcode:
[types usermeta="greenprint-client-organisation" user_is_author="true"][/types]

You are using attribute user_is_author="true", it will output the author of current post, if you need display current user information, please replace it with user_current="true", for example:
[types usermeta="greenprint-client-organisation" user_current="true"][/types]

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#textfield
click link "More Repeater attributes, User attributes, Term attributes, Usage examples":
"true" - output user field for the logged in user

#394472

Many thanks Luo

I see what you mean - silly mistake on my part. I did look for the solution but did not find the links you mentioned (now bookmarked!). These links are exactlt what I need.

Tony

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