PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / inc / cache / class-lp-courses-cache.php

class-lp-courses-cache.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at inc/cache/class-lp-courses-cache.php

53 lines 906 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class LP_Courses_Cache
5 *
6 * @author tungnx
7 * @since 4.1.5
8 * @version 1.0.0
9 */
10 defined( 'ABSPATH' ) || exit();
11
12 class LP_Courses_Cache extends LP_Cache {
13 /**
14 * @var LP_Courses_Cache
15 */
16 protected static $instance;
17 /**
18 * @var string
19 */
20 protected $key_group_child = 'courses';
21 /**
22 * @var string Save list keys cached to clear
23 */
24 public static $keys = 'keys';
25
26 /**
27 * Get instance
28 *
29 * @return self
30 */
31 public static function instance(): self {
32 if ( is_null( self::$instance ) ) {
33 self::$instance = new self();
34 }
35
36 return self::$instance;
37 }
38
39 protected function __construct() {
40 parent::__construct();
41 }
42
43 public function save_cache_keys( string $key_cache ) {
44 $keys_cache = $this->get_cache( self::$keys );
45 if ( false === $keys_cache ) {
46 $keys_cache = array();
47 }
48
49 $keys_cache[] = $key_cache;
50 $this->set_cache( self::$keys, $keys_cache );
51 }
52 }
53