Skip Navigation

[Resuelto] Saving data in cred generic field for email notification

This support ticket is created hace 4 años, 12 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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+00:00)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por kaneB hace 4 años, 11 meses.

Asistido por: Nigel.

Autor
Mensajes
#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

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00: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.