Support

Account

Home Forums Add-ons Repeater Field Check if $value does exist in any repeater subfield Reply To: Check if $value does exist in any repeater subfield

  • try something like this

    
    <?php
      
      $found = false;
      if (have_rows('dates')) {
        while(have_rows('dates')) {
          the_row();
          if ($value == get_sub_field('custom_date')) {
            $found = true;
            echo 'true';
          }
        } // end while have rows
      } // end if have rows
      if (!$found) {
        echo 'false';
      }
    ?>