Navigation überspringen

[Gelöst] Echo [title] from [value] option select field

This support ticket is created vor 1 year, 7 months. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 reply, hat 1 Stimme.

Zuletzt aktualisiert von quentinN vor 1 year, 6 months.

Assistiert von: Minesh.

Author
Artikel
#2783738
Capture d’écran 2024-11-14 à 15.51.14.png

Hello,
I would like to display the Title of an option in a select field rather than its value, which is just a slug.
How can I do this?
Best regards,
Quentin NORMAND

#2783933

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you try to use the Types PHP API function types_render_field() in order to display the select box selected option text.
- https://toolset.com/documentation/customizing-sites-using-php/functions/#select

For example:

$selected_option_text = types_render_field("type-viager", array());
echo $selected_option_text;
#2783979

It's work, thanks!