ACF_Repeater_Table::rows
Renders or returns rows for the repeater field table.
Method of the class: ACF_Repeater_Table{}
No Hooks.
Returns
Array|null.
Usage
$ACF_Repeater_Table = new ACF_Repeater_Table(); $ACF_Repeater_Table->rows( $return );
- $return(true|false)
- If we should return the rows or render them.
Default:false
Changelog
| Since 6.0.0 | Introduced. |
ACF_Repeater_Table::rows() ACF Repeater Table::rows code ACF 6.8.8
public function rows( $return = false ) {
$rows = array();
// Don't include the clone when rendering via AJAX.
if ( $return && isset( $this->value['acfcloneindex'] ) ) {
unset( $this->value['acfcloneindex'] );
}
foreach ( $this->value as $i => $row ) {
$rows[ $i ] = $this->row( $i, $row, $return );
}
if ( $return ) {
return $rows;
}
echo implode( PHP_EOL, $rows ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML already escaped by generating functions.
}