Support

Account

Home Forums ACF PRO Checkbox values not allowing conditional display Reply To: Checkbox values not allowing conditional display

  • not sure if I am looking at this wrong, but from what I see in the code, the dump of $currency shouldn’t be an array

    this bit here

    <?php 
        if(have_rows('currencies', 'option')): while(have_rows('currencies', 'option')): the_row();
            $currency = get_sub_field('currency');
        endwhile; else : endif;
    ?>

    This would overwrite the value of $currency with each iteration, try changing it to

    <?php 
        $currency = array();
        if(have_rows('currencies', 'option')): while(have_rows('currencies', 'option')): the_row();
            $currency[] = get_sub_field('currency');
        endwhile; else : endif;
    ?>

    and because currency is defined, you can eliminate the if($currency) and just use the in_array()