PluginProbe
MailerLite – WooCommerce integration / 3.1.26
MailerLite – WooCommerce integration v3.1.26
3.1.27 3.1.25 3.1.26 3.1.24 3.1.23 3.1.22 3.1.21 3.1.20 3.1.19 3.1.18 3.1.17 3.1.16 3.1.15 1.8.7 1.8.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 All 148 releases
woo-mailerlite / includes / WooMailerLiteCache.php

WooMailerLiteCache.php in MailerLite – WooCommerce integration 3.1.26, at includes/WooMailerLiteCache.php

32 lines 730 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class WooMailerLiteCache {
4
5 protected static $cacheKey = "woo_mailerlite_";
6
7 public static function set($key, $data, $seconds)
8 {
9 set_transient(self::$cacheKey . $key, $data, $seconds);
10 }
11
12 public static function get($key, $default = null)
13 {
14 $data = get_transient(self::$cacheKey . $key);
15 if ($data) {
16 return $data;
17 }
18 return $default;
19 }
20
21 public static function delete($key)
22 {
23 return delete_transient(self::$cacheKey . $key);
24 }
25
26 public static function pull($key, $default = null)
27 {
28 $data = self::get(self::$cacheKey . $key, $default);
29 self::delete(self::$cacheKey . $key);
30 return $data;
31 }
32 }