<?php

/**
 * Returns the cookies notification
 *
 * This function returns the cookies notification if
 * the cookie hasn't already been set. if the website
 * isn't live, the cookie will be set for the session
 * else it will be set for 30 days.
 *
 * @function cookies_bar()
 *
 * @uses ow_development()
 *
 * @param N/A
 *
 * @return (string) The cookies notification
 *
 * @since 1.1.0 
 *
 */
function cookies_bar() {
	
	if ( ! isset( $_COOKIE['ow_ac'] ) ) {
		
		$cookies = '<div id="cookie">';
		$cookies .= '<p>Our website uses cookies to enhance the visitor experience. Read how we use cookies <a href="/privacy-policy/">here</a>.</p>';
		$cookies .= '<span id="close-cookie" class="' . ow_development() . '">&times;</span>';
		$cookies .= '</div>';		
		echo $cookies;
	}
}
add_action( 'after_body', 'cookies_bar', 2 );