forked from jmarreros/CRUD-WordPress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
25 lines (18 loc) · 668 Bytes
/
delete.php
File metadata and controls
25 lines (18 loc) · 668 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
<?php
global $wpdb;
$sql = $wpdb->prepare( "SELECT name FROM " . TABLE_NAME . " WHERE id = %d", $id );
$name = $wpdb->get_var( $sql );
ob_start();
?>
<h3>¿Estas seguro de eliminar <?= $name ?>?</h3>
<form method="post" action="<?= admin_url( 'admin-post.php' ) ?>" class="frm-detail-fruits">
<input type="hidden" name="id" value="<?= $id ?>">
<?php wp_nonce_field( 'fruits-nonce', 'nonce' ); ?>
<input type="hidden" name="action" value="delete_custom_fruit">
<input type="submit" name="submit" value="Eliminar">
<a href="<?= home_url( SLUG_PAGE ) ?>">Cancelar</a>
</form>
<?php
$str_form = ob_get_contents();
ob_end_clean();
return $str_form;