class-wpml-cookie-setting.php
701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Class WPML_Frontend_Cookie_Setting
*/
class WPML_Cookie_Setting {
const COOKIE_SETTING_FIELD = 'store_frontend_cookie';
/**
* @var SitePress
*/
private $sitepress;
/**
* WPML_Frontend_Cookie_Setting constructor.
*
* @param SitePress $sitepress
*/
public function __construct( SitePress $sitepress ) {
$this->sitepress = $sitepress;
}
/**
* @return bool|mixed
*/
public function get_setting() {
return $this->sitepress->get_setting( self::COOKIE_SETTING_FIELD );
}
/**
* @param mixed $value
*/
public function set_setting( $value ) {
$this->sitepress->set_setting( self::COOKIE_SETTING_FIELD, $value );
$this->sitepress->save_settings();
}
}