Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array(
- 'label' => __('Quiz Contents', 'framework'),
- 'desc' => __('Create quiz question, answer, and options', 'framework'),
- 'id' => $prefix . 'frenzy_quiz',
- 'type' => 'repeatable-group',
- 'groupfield' => array(
- array( 'label' => __('Name of the artist', 'framework'),
- 'type' => 'text',
- ),
- array( 'label' => __('Artist Album List', 'framework'),
- 'type' => 'textarea',
- ),
- array( 'label' => __('Artist Homepage', 'framework'),
- 'type' => 'text',
- ),
- ),
- 'location' => 'post',
- ),
- case 'repeatable-group':
- echo '<a class="repeatable-add button" href="#">+' . __('Add Row','framework') . '</a>
- <ul id="'.$field['id'].'-repeatable" class="custom_repeatable repeatable_group">';
- $i = 0;
- if($meta) {
- foreach($meta as $row) {
- $j = 0;
- echo '<li>';
- foreach($field['groupfield'] as $groupfield) {
- switch ($groupfield['type']) {
- case 'text':
- echo '
- <p><label>'.$groupfield['label'].'</label><input size="30" type="text" name="'.$field['id'].'['.$i.']['.$j.']" id="'.$field['id'].'" value="" size="30" /></p>';
- break;
- case 'textarea':
- echo '<p><label>'.$groupfield['label'].'</label>
- <textarea name="'.$field['id'].'['.$i.']['.$j.']" id="'.$field['id'].'" row="20" cols="35"></textarea>
- </p>';
- break;
- }
- $j++;
- }
- echo '<a class="repeatable-remove button" href="#">-</a></li>';
- $i++;
- }
- }
- else {
- $j = 0;
- echo '<li>';
- foreach($field['groupfield'] as $groupfield) {
- switch ($groupfield['type']) {
- case 'text':
- echo '
- <p><label>'.$groupfield['label'].'</label><input size="30" type="text" name="'.$field['id'].'['.$i.']['.$j.']" id="'.$field['id'].'" value="" size="30" /></p>';
- break;
- case 'textarea':
- echo '<p><label>'.$groupfield['label'].'</label>
- <textarea name="'.$field['id'].'['.$i.']['.$j.']" id="'.$field['id'].'" row="20" cols="35"></textarea>
- </p>';
- break;
- }
- $j++;
- }
- echo '<a class="repeatable-remove button" href="#">-</a></li>';
- }
- echo '</ul>
- <span class="description">'.$field['desc'].'</span>';
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement