# insert-html-snippet/1.2.4/ajax-handler.php

Insert Html Snippet, version 1.2.4. 25 lines.

- Page: https://pluginprobe.com/plugins/insert-html-snippet/1.2.4/code/ajax-handler.php
- Raw: https://pluginprobe.com/plugins/insert-html-snippet/1.2.4/raw/ajax-handler.php
- Modified: 2018-03-27T17:04:10+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.2.4/code/ajax-handler.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) )
	exit;


add_action('wp_ajax_ihs_backlink', 'xyz_ihs_ajax_backlink');
function xyz_ihs_ajax_backlink() {
	check_ajax_referer('xyz-ihs-blink','security');
    if(current_user_can('administrator')){
        global $wpdb;
        if(isset($_POST)){
            if(intval($_POST['enable'])==1){
                update_option('xyz_credit_link','ihs');
                echo 1;
            }
            if(intval($_POST['enable'])==-1){
                update_option('xyz_ihs_credit_dismiss','dis');
                echo -1;
            }
        }
    }die;
}

?>

```
