Add cookiename to js params
This commit is contained in:
@ -52,6 +52,7 @@ class CWV3 {
|
|||||||
'id' => $p_ID,
|
'id' => $p_ID,
|
||||||
'opacity' => get_option( 'cwv3_bg_opacity', 0.85 ),
|
'opacity' => get_option( 'cwv3_bg_opacity', 0.85 ),
|
||||||
'cookie_path' => SITECOOKIEPATH,
|
'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' );
|
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 ) {
|
public function set_cookie( $id, $action ) {
|
||||||
|
|
||||||
$time = get_option( 'cwv3_death' );
|
$time = get_option( 'cwv3_death' );
|
||||||
|
Reference in New Issue
Block a user