Problem:
The code to add commas to the numbers to separate the thousands shows 0 when the result of the custom field is empty.
Solution:
Change the code to this:
add_shortcode( 'ts_format_number', 'ts_format_number_func'); function ts_format_number_func( $atts, $content ) { $int = (int) do_shortcode($content); if ($int == null) { return ""; } else { return number_format($int, 0); } }
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.
This topic contains 2 replies, has 2 voices.
Last updated by 3 years, 3 months ago.
Assisted by: Christopher Amirian.