Support

Account

Home Forums ACF PRO How to hide sub fields in a field group… Reply To: How to hide sub fields in a field group…

  • Very hard to tell without code, but I would probably use an output buffer, and also only output the rows of the table that have available set to yes.

    
    ob_start();
    $something_available = false; // flag to note something is available
    if (have_rows('units')) {
      while (have_rows('units')) {
        the_row();
        if (get_sub_field('available')) {
          // this one is available
          // output this row of the table
          // and set our flag to true
          $something_available = true;
        } // end if available
      } // end while have_rows
    } // end if have_rows
    $content = ob_get_clean();
    if ($something_available) {
      // only output if something is available
      echo $content;
    }