API
1 week ago
AdminDashboard
1 week ago
AdminNotices
1 week ago
AdminTexts
3 years ago
Attributes
1 week ago
Block
1 week ago
CLI
5 years ago
COT
1 week ago
CacheInvalidate
1 week ago
Container
1 week ago
Coupons
1 week ago
DisplayAsTranslated
1 week ago
DownloadableFiles
1 week ago
EditorScopedSync
1 week ago
Email
1 week ago
Endpoints
1 week ago
Exporter
1 week ago
HomeScreen
1 month ago
Importer
1 week ago
MO
1 week ago
Multicurrency
1 week ago
Options
1 week ago
OrderItems
1 week ago
Orders
1 week ago
PaymentGateways
1 week ago
Permalinks
1 week ago
PointerUi
1 week ago
PostHog
1 month ago
Reports
1 week ago
Rest
1 week ago
Reviews
1 week ago
RewriteRules
1 week ago
StandAlone
1 week ago
Synchronization
1 week ago
TMDashboard
1 week ago
Tax
1 week ago
Terms
1 week ago
TranslationControls
1 week ago
TranslationJob
1 week ago
User
1 week ago
Utilities
1 week ago
WcEmailSettings
1 week ago
currencies
1 week ago
media
1 week ago
multi-currency
1 week ago
order-property-filter
1 week ago
pointers
1 week ago
privacy
1 week ago
product
1 week ago
shortcodes
1 week ago
taxonomy-translation
1 week ago
templates
1 week ago
url-filters
1 week ago
urls
1 week ago
wcml-setup
1 week ago
class-wcml-admin-cookie.php
1 week ago
class-wcml-tracking-link.php
1 week ago
class-woocommerce-wpml.php
1 week ago
class-wcml-admin-cookie.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Admin_Cookie { |
| 4 | |
| 5 | private $name; |
| 6 | |
| 7 | public function __construct( $name ) { |
| 8 | $this->name = $name; |
| 9 | } |
| 10 | |
| 11 | public function set_value( $value, $expiration = null ) { |
| 12 | if ( null === $expiration ) { |
| 13 | $expiration = time() + DAY_IN_SECONDS; |
| 14 | } |
| 15 | wc_setcookie( $this->name, $value, $expiration ); |
| 16 | } |
| 17 | |
| 18 | public function get_value() { |
| 19 | $value = null; |
| 20 | if ( isset( $_COOKIE [ $this->name ] ) ) { |
| 21 | $value = $_COOKIE[ $this->name ]; |
| 22 | } |
| 23 | return $value; |
| 24 | } |
| 25 | } |
| 26 |