Controls
Repeater
Repeater control allows you to create a set of sub controls which can be repeated again and again whilst editing content! See examples below to use this control.
All controls except Inner Blocks can be added as a sub-control which allows you to create and manage very customized data with ease!
Control Settings
- Row Label – the text displayed in the row label. There is possibility to use the inner control values, for example: "My row number {{#}} with inner control {{control_name}}"
- Add Button Label – the text displayed on the "Add Row" button
- Minimum Rows – the minimum number of rows allowed
- Maximum Rows – the maximum number of rows allowed
- Collapsible Rows – allow collapse rows by clicking on it
Usage
PHP
<?php foreach( $attributes['control_name'] as $inner ): ?>
<p>
<?php echo $inner['inner_control_name']; ?>
</p>
<?php endforeach; ?>
Handlebars
{{#each control_name}}
<p>
{{inner_control_name}}
</p>
{{/each}}
Post Meta
$repeater = get_lzb_meta( 'control_meta_name' );
foreach ( $repeater as $inner_control ) {
?>
<p><?php echo $inner_control; ?></p>
<?php
}