Add cookiename to js params

This commit is contained in:
Jay Wood
2014-11-09 23:15:53 -05:00
parent 52030fb47c
commit 4554bd26a2

View File

@ -52,6 +52,7 @@ class CWV3 {
'id' => $p_ID,
'opacity' => get_option( 'cwv3_bg_opacity', 0.85 ),
'cookie_path' => SITECOOKIEPATH,
'cookie_name' => $this->get_cookie_name(),
) );
}
@ -70,6 +71,23 @@ class CWV3 {
wp_register_style( 'cwv3_css', plugins_url( "css/cwv3{$min}.css", dirname( __FILE__ ) ), array( 'colorbox' ), '1.0' );
}
public function get_cookie_name(){
$sitewide = get_option( 'cwv3_sitewide' );
$homepage = get_option( 'cwv3_homepage' );
$misc = get_option( 'cwv3_misc' );
if( 'enabled' == ! empty( $sitewide ) ){
return 'sitewide';
}
if( 'enabled' == ! empty( $homepage ) && is_front_page() ){
return 'homepage';
}
return false;
}
public function set_cookie( $id, $action ) {
$time = get_option( 'cwv3_death' );