PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
← All changes | App/Services/Transient/Transient.php +14 -5 3.13.5.9 View file →
@@ -13,24 +13,33 @@
13 13
14 14 $this->prefix = !empty($config['prefix']) ? $config['prefix'] : '';
15 15 }
16 16
17 - public function set($key, $val, $expiration = YEAR_IN_SECONDS) {
17 + public function set($key, $val, $expiration = YEAR_IN_SECONDS): bool
18 + {
18 19
19 20 return set_transient( $this->prefix.$key, $val, $expiration );
20 21 }
21 22
22 - public function get($key) {
23 + public function get($key, $default = null) {
23 24
24 - return get_transient( $this->prefix.$key );
25 + $value = get_transient( $this->prefix.$key );
26 +
27 + if($value === false) {
28 + return $default;
29 + }
30 +
31 + return $value;
25 32 }
26 33
27 - public function delete($key) {
34 + public function delete($key): bool
35 + {
28 36
29 37 return delete_transient( $this->prefix.$key );
30 38 }
31 39
32 - public function exists($key) {
40 + public function exists($key): bool
41 + {
33 42
34 43 return $this->get( $key ) !== false;
35 44 }
36 45