Skip to content

Commit 144ebbb

Browse files
fantastlcoklwl12
authored andcommitted
将transient改为wp_cache储存缓存 (#137)
* Update class.json.php 将transient改为wp_cache储存缓存 * Update hermit.php
1 parent eb07dd2 commit 144ebbb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

class.json.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,19 +433,19 @@ public function curl($API)
433433

434434
public function get_cache($key)
435435
{
436-
$cache = get_transient($key);
436+
$cache = wp_cache_get( $key, 'hermitx' );
437437
return $cache === false ? false : json_decode($cache, true);
438438
}
439439

440440
public function set_cache($key, $value, $hour = 0.1)
441441
{
442442
$value = json_encode($value);
443-
set_transient($key, $value, 60 * 60 * $hour);
443+
wp_cache_set( $key, $value, 'hermitx', 60 * 60 * $hour );
444444
}
445445

446446
public function clear_cache($key)
447447
{
448-
//delete_transient($key);
448+
//wp_cache_delete($key, 'hermitx');
449449
}
450450

451451
/**

hermit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Plugin Name: Hermit X
44
Plugin URI: https://blog.lwl12.com/read/hermit-x.html
55
Description: 音乐播放器 Hermit music player build for wordpress with APlayer
6-
Version: 2.9.4
6+
Version: 2.9.5
77
Author: Hermit X Developer Team
88
Author URI: https://blog.lwl12.com/read/hermit-x.html#developer
99
*/
1010

1111
define('HERMIT_FILE', __FILE__);
12-
define('HERMIT_VERSION', '2.9.4');
12+
define('HERMIT_VERSION', '2.9.5');
1313
define('HERMIT_URL', plugins_url('', __FILE__));
1414
define('HERMIT_PATH', dirname(__FILE__));
1515
define('HERMIT_ADMIN_URL', admin_url());

0 commit comments

Comments
 (0)