API
1 month ago
AdminDashboard
1 month ago
AdminNotices
1 month ago
AdminTexts
3 years ago
Attributes
1 month ago
Block
1 month ago
CLI
5 years ago
COT
1 month ago
CacheInvalidate
1 month ago
Container
1 month ago
Coupons
1 month ago
DisplayAsTranslated
1 month ago
DownloadableFiles
1 month ago
EditorScopedSync
1 month ago
Email
1 month ago
Endpoints
1 month ago
Exporter
1 month ago
HomeScreen
2 months ago
Importer
1 month ago
MO
1 month ago
Multicurrency
1 month ago
Options
1 month ago
OrderItems
1 month ago
Orders
1 month ago
PaymentGateways
1 month ago
Permalinks
1 month ago
PointerUi
1 month ago
PostHog
2 months ago
Reports
1 month ago
Rest
1 month ago
Reviews
1 month ago
RewriteRules
1 month ago
StandAlone
1 month ago
Synchronization
1 month ago
TMDashboard
1 month ago
Tax
1 month ago
Terms
1 month ago
TranslationControls
1 month ago
TranslationJob
1 month ago
User
1 month ago
Utilities
1 month ago
WcEmailSettings
1 month ago
currencies
1 month ago
media
1 month ago
multi-currency
1 month ago
order-property-filter
1 month ago
pointers
1 month ago
privacy
1 month ago
product
1 month ago
shortcodes
1 month ago
taxonomy-translation
1 month ago
templates
1 month ago
url-filters
1 month ago
urls
1 month ago
wcml-setup
1 month ago
class-wcml-admin-cookie.php
1 month ago
class-wcml-tracking-link.php
1 month ago
class-woocommerce-wpml.php
1 month 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 |