Problem: I would like to set the value of a cred_field with the value of an email custom field in the current User's profile. When I use the Types usermeta shortcode, the value is not set correctly. If I place the same types usermeta shortcode outside the CRED field, I see the correct email address.
Solution: The Types usermeta shortcode will output a full HTML email address link, which won't work in a cred_field value attribute. Instead, you should use the wpv-user shortcode to output only the email address:
<div class="form-group"> <label>Contact Email</label> [cred_field field='eoi-contact-email' post='expression-interest' value="[wpv-user field='wpcf-contact-email-universal']" urlparam="" class='form-control' output='bootstrap'] </div>
Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/#email
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
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 |
---|---|---|---|---|---|---|
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)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Christian Cox.