table.php
820 Bytes
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
<?php
use AC\Admin\Table;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* @var Table $table
*/
$table = $this->table;
?>
<table class="widefat fixed ac-table">
<thead>
<?php foreach ( $table->get_headings() as $key => $label ) : ?>
<th class="<?= $key ?>"><?= $label ?></th>
<?php endforeach; ?>
</thead>
<tbody>
<?php foreach ( $table->get_rows() as $row ) : ?>
<tr>
<?php foreach ( array_keys( $table->get_headings() ) as $key ) : ?>
<td class="<?= $key ?>">
<?= $table->get_column( $key, $row ) ?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
<?php if ( $table->has_message() ) : ?>
<tfoot>
<tr class="message">
<td colspan="<?= count( $table->get_headings() ) ?>">
<?= $table->get_message() ?>
</td>
</tr>
</tfoot>
<?php endif; ?>
</table>