Skip Navigation

[Resolved] Checkboxe value not showing

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display custom checkboxes field values using PHP codes.

Solution:

you can specific the post ID parameter in types_render_field() function, for example:

https://toolset.com/forums/topic/checkboxe-value-not-showing/#post-1444037

Relevant Documentation:

This support ticket is created 5 years 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
- 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 6 replies, has 2 voices.

Last updated by christopherH-7 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1443927
Screenshot_10.jpg
Screenshot_1.jpg

Hi,

I have created checkbox using toolset fields and used them on custom post form. When I am trying to get the checkbox value on the frontend using PHP its not showing. I have used these functions to get the value :

$carrieroperation = get_post_meta( $carrier_id, 'wpcf-carrieroperation', true );
$carrieroperation = types_render_field( "carrieroperation", array( "separator" => ", " ) );

please check attached screenshot as well for field name.

#1444037

Hello,

In you case, I suggest you try to specific the post ID parameter in types_render_field function, for example:

$carrieroperation = types_render_field( "carrieroperation", array( "separator" => ", ", "post_id"=>$carrier_id) );

And test again

#1445735

I have tried with ID as well but no luck, nothing showing.

#1445737

Since it is a custom PHP codes problem, please provide a test site with the same problem, also point out the problem page URL and where I can edit your PHP codes, I need to test it in a live website, thanks

#1446425

Can we do a screen share, please let me know your best time for the meeting so we can check the issue.

#1447865

I have tried the PHP codes in my localhost with a fresh wordpress installation + the latest version of Toolset plugins, it works fine.

So I don't think screenshots will help.

Please check these in your website:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and where I can edit your PHP codes, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1448705

My issue is resolved now. Thank you!