Saltar navegación

[Resuelto] Echo [title] from [value] option select 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
- 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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 1 respuesta, tiene 1 mensaje.

Última actualización por quentinN 1 year, 6 months ago.

Asistido por: Minesh.

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

Idiomas: Inglés (English )

Zona horaria: 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!