Skip Navigation

[Resolved] Php show select Description text

This support ticket is created 4 years, 9 months ago. 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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by alejod 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1584979

Hi, I've created a country custom Select field
I'm trying to retrieve from php the display text.
When using: get_post_meta( get_the_ID(), 'wpcf-countries', true );
But I need the display text instead of that. I tried : types_render_field("wpcf-countries", array('output' => 'html')); without success.
Thanks

#1585139

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

The issue is you should not use the wpcf- prefix with the Types API function: types_render_field()

Can you please try to use the following way:

echo types_render_field("countries");

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#select

#1585145

jaja I can't believe it was that! I spent ours testing different codes!
Thanks a lot! It's know solved!