Support

Account

Home Forums Add-ons Repeater Field True/False in Repeater always returning false Reply To: True/False in Repeater always returning false

  • G’day Mate,

    the true/false fields always return boolean regardless of what you put in the field setting. The field setting is only for admin UI, and has nothing to do with the return value.

    So, you code really only need to check if the return is truethy, not if it’s equal to ‘yes’:

    
    <?php if ( get_field('whats_up_walk_in') ): ?>
    	Yes
    <?php else: ?>
    	No
    <?php endif; ?>
    
    // or just
    <?php echo get_field('whats_up_walk_in')? 'yes' : 'no'; ?>
    

    Cheers