block_row()

Description

The block_row() function will prepare a loop with the first or next row in a repeater. Similar to has_posts().

block_row( $name );

Parameters

  • $name (string) (Required) The repeater field name.

Usage

if ( block_rows( 'my-repeater' ) ) :
  while ( block_rows( 'my-repeater' ) ) :
    block_row( 'my-repeater' );

    block_sub_field( 'my-text-field' );

    $foo = block_sub_value( 'my-checkbox' );
    if ( $foo ) {
      // Do something.  
    }
  endwhile;
endif;