repeater.php
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Outputs a repeater field in the TinyMCE modal
*
* @since 1.4.9
*
* @package Media_Library_Organizer
* @author WP Media Library
*/
?>
<div class="wpzinc-option">
<div class="full">
<table class="widefat">
<thead>
<tr>
<?php
foreach ( $field['sub_fields'] as $sub_field_name => $sub_field ) {
?>
<th><?php echo esc_html( $sub_field['label'] ); ?></th>
<?php
}
?>
<th><?php esc_html_e( 'Actions', 'media-library-organizer' ); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<button class="wpzinc-add-table-row button" data-table-row-selector="repeater-row">
<?php esc_html_e( 'Add', 'media-library-organizer' ); ?>
</button>
</td>
</tr>
</tfoot>
<tbody id="<?php echo esc_attr( $shortcode['name'] ); ?>-<?php echo esc_attr( $field_name ); ?>">
<tr id="<?php echo esc_attr( $shortcode['name'] ); ?>-<?php echo esc_attr( $field_name ); ?>-row" class="repeater-row hidden">
<?php
$sub_fields = $field['sub_fields'];
foreach ( $sub_fields as $field_name => $field ) {
?>
<td>
<?php include 'field.php'; ?>
</td>
<?php
}
?>
<td>
<a href="#" class="wpzinc-delete-table-row">
<?php esc_html_e( 'Delete', 'media-library-organizer' ); ?>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>