PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 1.1.3
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v1.1.3
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
templately / core / class-plugin.php

class-plugin.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 1.1.3, at core/class-plugin.php

105 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Templately plugin.
4 *
5 * The main plugin handler class is responsible for initializing Templately. The
6 * class registers and all the components required to run the plugin.
7 *
8 * @package Templately
9 */
10
11 namespace Templately;
12
13 defined('ABSPATH') or exit;
14
15 use Templately\Admin\Admin;
16
17 final class Plugin {
18 /**
19 * Plugin Version
20 * @var string
21 */
22 protected static $version;
23 /**
24 * Plugin Name
25 * @var string
26 */
27 protected static $plugin_name;
28 /**
29 * Plugin Instance
30 * @var \Templately\Plugin
31 */
32 private static $_instance = null;
33 /**
34 * Elementor Instance
35 *
36 * @var \Templately\Elementor
37 */
38 public $elementor = null;
39 /**
40 * Admin Instance
41 *
42 * @var \Templately\Admin\Admin
43 */
44 public $admin = null;
45
46 /**
47 * Get a single instance of Plugin
48 * @return Plugin
49 */
50 public static function get_instance() {
51 if (is_null(self::$_instance)) {
52 self::$_instance = new self();
53 }
54 return self::$_instance;
55 }
56
57 /**
58 * Plugin constructor.
59 * Initializing Templately plugin.
60 *
61 * @access private
62 */
63 private function __construct() {
64 if (defined('TEMPLATELY_VERSION')) {
65 self::$version = TEMPLATELY_VERSION;
66 } else {
67 self::$version = '0.0.1';
68 }
69 Installer::init();
70 self::$plugin_name = 'templately';
71 $this->admin = Admin::get_instance();
72 $this->elementor = Elementor::get_instance();
73 self::run();
74 do_action('templately_init');
75 }
76
77 /**
78 * Run all actions and hooks
79 *
80 * @return void
81 */
82 public static function run() {
83 /**
84 * Loader will run actions and filters function for the plugin.
85 */
86 Loader::run();
87 }
88
89 /**
90 * Get Plugin Name or You can say Text Domain
91 * @return string
92 */
93 public static function get_name() {
94 return self::$plugin_name;
95 }
96
97 /**
98 * Get Plugin Version
99 * @return String
100 */
101 public static function get_version() {
102 return self::$version;
103 }
104 }
105