PluginProbe
Ultimate Store Kit / 3.0.8
Ultimate Store Kit v3.0.8
3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 92 releases
ultimate-store-kit / base / singleton.php

singleton.php in Ultimate Store Kit 3.0.8, at base/singleton.php

34 lines 625 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Base;
4
5 if (!defined('ABSPATH')) {
6 exit; // Exit if accessed directly.
7 }
8
9
10 trait Singleton {
11
12 private static $instance;
13
14 public static function instance() {
15 if (!self::$instance) {
16 self::$instance = new self();
17 }
18
19 return self::$instance;
20 }
21
22 public static function get_instance() {
23 return self::instance();
24 }
25
26 public function __clone() {
27 _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&#8217; huh?', 'ultimate-store-kit'), '1.0.0');
28 }
29
30 public function __wakeup() {
31 _doing_it_wrong(__FUNCTION__, esc_html__('Cheatin&#8217; huh?', 'ultimate-store-kit'), '1.0.0');
32 }
33 }
34