settings.php
927 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
<?php
namespace FakerPress;
use FakerPress\Fields;
// Fetch view from Template Vars
$view = $this->get( 'view' );
if ( ! $view ) {
return;
}
$fields[] = new Field(
'text',
[
'id' => 'erase_phrase',
'placeholder' => 'The cold never bothered me anyway!',
],
[
'label' => __( 'Erase faked data', 'fakerpress' ),
'description' => __( 'To erase all data generated type "<b>Let it Go!</b>".', 'fakerpress' ),
'actions' => [
'delete' => __( 'Delete!', 'fakerpress' ),
],
]
);
?>
<div class='wrap'>
<h2><?php echo esc_attr( $view->title ); ?></h2>
<form method='post'>
<?php wp_nonce_field( Plugin::$slug . '.request.' . $view->slug . ( isset( $view->action ) ? '.' . $view->action : '' ) ); ?>
<table class="form-table" style="display: table;">
<tbody>
<?php foreach ( $fields as $field ) : ?>
<?php $field->output( true ); ?>
<?php endforeach; ?>
</tbody>
</table>
</form>
</div>