<?php 'repeater_history' => array( 'type' => 'repeater', 'label' => __( 'Taby' , 'engine' ), 'item_name' => __( 'Tab', 'engine' ), 'item_label' => array( 'selector' => "[id*='name']", 'update_event' => 'change', 'value_method' => 'val' ), 'fields' => array( 'name' => array( 'type' => 'text', 'label' => __('Nazwa zakładki', 'engine'), 'default' => '', ), 'repeater_inner' => array( 'type' => 'repeater', 'label' => __( 'Treści' , 'engine' ), 'item_name' => __( 'Tekst', 'engine' ), 'item_label' => array( 'selector' => "[id*='text']", 'update_event' => 'change', 'value_method' => 'val' ), 'fields' => array( 'text' => array( 'type' => 'text', 'label' => __( 'Tekst', 'engine' ), ), ) ) ) ), ?> //tpl.php <?php $repeater_history = $instance['repeater_history']; ?> <?php if(sizeof((array)$repeater_history) > 0 && !empty($repeater_history)) { ?> <?php foreach ((array)$repeater_history as $history => $value) { ?> <?php foreach ((array)$value['repeater_inner'] as $inner => $detail) { ?> <?php echo $detail['text']; ?> <?php } ?> <?php } ?> <?php } ?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter