# insert-html-snippet/1.3.1/admin/snippet-delete.php

Insert Html Snippet, version 1.3.1. 28 lines.

- Page: https://pluginprobe.com/plugins/insert-html-snippet/1.3.1/code/admin/snippet-delete.php
- Raw: https://pluginprobe.com/plugins/insert-html-snippet/1.3.1/raw/admin/snippet-delete.php
- Modified: 2019-10-25T09:59:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/insert-html-snippet/1.3.1/code/admin/snippet-delete.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) 
	exit;
global $wpdb;
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$xyz_ihs_snippetId = intval($_GET['snippetId']);
$xyz_ihs_pageno = intval($_GET['pageno']);
if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ihs-del_'.$xyz_ihs_snippetId )) {
	wp_nonce_ays( 'ihs-del_'.$xyz_ihs_snippetId );
	exit;
} 
else {
	if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
		header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
		exit();
	}
	$snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1',$xyz_ihs_snippetId )) ;
	if($snippetCount==0){
		header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
		exit();
	}else{
		$wpdb->query($wpdb->prepare( 'DELETE FROM  '.$wpdb->prefix.'xyz_ihs_short_code  WHERE id=%d',$xyz_ihs_snippetId)) ;
		header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno));
		exit();
	}
}
?>
```
