<?php

function get_slug() {
$post_data = get_post($post->ID, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}


// Set the cookie
if( isset( $_POST["setCookie"] ) ){

	if( $_POST["setCookie"] == "true" ){
		
		// Save cookie
		setcookie( 'bt_attentionGrabber_active', "123", time()+(60*60*24*30), '/' );
		
	}else{
		
		// Delete cookie
		setcookie( 'bt_attentionGrabber_active', null, -1, '/' );
	
	}

}

// Get the cookie
function get_the_cookie( $keepHidden ){
	
	global $the_attentionGrabber;
	
	$found_cookie = "false";
	
	if( $keepHidden ){
	
		$cookie = $_COOKIE['bt_attentionGrabber_active'];
		$val = $the_attentionGrabber["id"]+123;
		
		if( isset($cookie) && ($cookie == $val) ){
		
			$found_cookie = "true";
		
		}
	
	}

	return $found_cookie;
}


?>