Hey there and thanks for replying.
It’s not possible to access the site this week as it’s in active development and I have to get this app out the door!
But I did some testing on the field for you -
- When the result is 0 and fallback=“0” the output is “”
- When the result is 0 and the fallack=“1” the output is “1”
- When the result is NOT 0 and the fallback=“1” the output matches the input.
- When the result is 0 and the fallback statement is removed, the output = “0”
The function I’m using looks a little like this - it returns an array where one of the columns called “student” is 0 or a positive integer.
function s2w_my_tutor_cohorts($result, $params) {
global $wpdb;
$result = $wpdb->get_results(" ***** QUERY REMOVED **** ", ARRAY_A);
return $result;
}
add_filter( 'cs_looper_custom_tutor_cohorts', 's2w_my_tutor_cohorts', 10, 2);
This works:
<span>{{dc:looper:field key="students"}}</span>
This does not work correctly when students is zero:
<span>{{dc:looper:field key="students" fallback="0"}}</span>
I hope this helps you track it down!