forked from jmarreros/CRUD-WordPress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.php
More file actions
44 lines (40 loc) · 1.4 KB
/
new.php
File metadata and controls
44 lines (40 loc) · 1.4 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
<?php
ob_start();
?>
<form method="post" action="<?= admin_url( 'admin-post.php' ) ?>" class="frm-detail-fruits">
<div>
<label for="name">Nombre:</label>
<input type="text" name="name" id="name" required value="">
</div>
<div>
<label for="variety">Variedad:</label>
<input type="text" name="variety" id="variety" required value="">
</div>
<div>
<label for="name">Tipo:</label>
<select name="type" id="type">
<option value="1">Tipo 1</option>
<option value="2">Tipo 2</option>
<option value="3">Tipo 3</option>
<option value="4">Tipo 4</option>
</select>
</div>
<div>
<label for="date">Fecha:</label>
<input type="date" name="date" id="date" value="">
</div>
<div>
<label for="comment">Comentarios:</label>
<textarea name="comment" id="comment" cols="20" rows="5"></textarea>
</div>
<div>
<input type="hidden" name="id" value="0">
<?php wp_nonce_field( 'fruits-nonce', 'nonce' ); ?>
<input type="hidden" name="action" value="save_custom_fruit">
<input type="submit" name="submit" value="Grabar">
</div>
</form>
<?php
$str_form = ob_get_contents();
ob_end_clean();
return $str_form;