Skip Navigation

[Gelöst] Saving data in cred generic field for email notification

This support ticket is created vor 4 Jahre, 4 Monate. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by kaneB vor 4 Jahre, 4 Monate.

Assisted by: Nigel.

Author
Artikel
#1402515

I have a toolset form where I need to select the "owner" and when the form is submitted, the owner needs to be notified on email. For the time being the owners are static as I hardcoded them in the cred generic field approach (https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/)

Problem is I cannot display this "owner" with views. I have tried creating a custom field (select type) and call it the same name as my generic field, using persist:1 but the data is still not saved (https://toolset.com/forums/topic/dynamic-cred-generic-field-options-how-and-where-can-i-save-values-from-them/ #525310).

I need help to save the data of "owner" so I can display on frontend using views.

#1402857

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

I can't see the specifics of your set up, so let me make a couple of observations.

First: if you have a field in the form that you want to save so that it can later be displayed you should probably go ahead and create and assign such a custom field with Types, rather than using generic fields with "persist": 1.

Second: Types custom fields use a wpcf- prefix for the post meta key, whereas if you add a generic field with "persist":1 it will get saved with the slug of the field as the post meta key, without such a prefix.

To output a non-Types field, you would use the wpv-post-field shortcode (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-field) rather than a types shortcode.

If you believe that the generic field is not getting saved, you should verify this in the only place that you can tell for sure, i.e. in the database. Check the wp_postmeta table corresponding to the post in question, and confirm which custom fields have been saved.

#1403515

Excellent! This wpv-post-field shortcode solved my problem. Thank you.

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