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 / class-lp-template.php

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

64 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class LP_Template
5 *
6 * @since 3.3.0
7 */
8 class LP_Template implements ArrayAccess {
9 /**
10 * @var LP_Template
11 */
12 protected static $instance = null;
13
14 public $templates = array();
15
16 /**
17 * LP_Template constructor.
18 */
19 protected function __construct() {
20 $this->templates = apply_filters(
21 'learn-press/templates-classes',
22 array(
23 'general' => include_once 'templates/class-lp-template-general.php',
24 'course' => include_once 'templates/class-lp-template-course.php',
25 'checkout' => include_once 'templates/class-lp-template-checkout.php',
26 'profile' => include_once 'templates/class-lp-template-profile.php',
27 )
28 );
29 }
30
31 public function has_content( $where ) {
32 return has_action( $where );
33 }
34
35 public function offsetGet( $offset ) {
36 return ! empty( $this->templates[ $offset ] ) ? $this->templates[ $offset ] : false;
37 }
38
39 public function offsetSet( $offset, $value ) {
40 return false;
41 }
42
43 public function offsetExists( $offset ) {
44 return ! empty( $this->templates[ $offset ] );
45 }
46
47 public function offsetUnset( $offset ) {
48 return false;
49 }
50
51 /**
52 * Instance lp template
53 *
54 * @return LP_Template
55 */
56 public static function instance() {
57 if ( ! self::$instance ) {
58 self::$instance = new self();
59 }
60
61 return self::$instance;
62 }
63 }
64