Skip Navigation

[Résolu] Possible to pass extra data to generic field?

This support ticket is created Il y a 4 années et 5 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 1 réponse, has 2 voix.

Last updated by Luo Yang Il y a 4 années et 5 mois.

Assisted by: Luo Yang.

Auteur
Publications
#1373607

I've got a view that populates a generic select field using the usual {"value":"[wpv-post-id]","label":"[wpv-post-title]"} setup.

Is it possible to send extra data to the options- something like {"value":"[wpv-post-id]","label":"[wpv-post-title]","data-slug":"[wpv-post-slug]"}

I ask because I've tried the above and it doesn't seem to work.

Thanks in advance!

#1373651

Hello,

I assume we are talking about the Toolset Forms shortcode [cred_generic_field], see our document:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field
There isn't such kind of feature within above shortcode.

You might consider custom codes, for example in your codes, there is post ID value, so you can use it to get post's slug with PHP codes, for example, this thread:
https://wordpress.stackexchange.com/questions/11426/how-can-i-get-page-slug

More help:
https://codex.wordpress.org/Function_Reference/get_post_field

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