PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.8.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.8.0
3.8.0 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 All 112 releases
templately / vendor / priyomukul / wp-notice / src / Utils / Base.php

Base.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 3.8.0, at vendor/priyomukul/wp-notice/src/Utils/Base.php

45 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PriyoMukul\WPNotice\Utils;
4
5 #[\AllowDynamicProperties]
6 abstract class Base {
7 /**
8 * Holds the plugin instance.
9 *
10 * @since 2.0.0
11 * @access protected
12 * @static
13 *
14 * @var Base
15 */
16 private static $instances = [];
17
18 /**
19 * Sets up a single instance of the plugin.
20 *
21 * @return static An instance of the class.
22 * @since 1.0.0
23 * @access public
24 * @static
25 *
26 */
27 public static function get_instance( ...$args ) {
28 $module = get_called_class();
29 $module_id = $module;
30
31 if ( $module === 'PriyoMukul\WPNotice\Notice' || $module === 'PriyoMukul\WPNotice\Dismiss' ) {
32 $module_id = $module . '::' . $args[0];
33 }
34
35 if ( ! isset( self::$instances[ $module_id ] ) ) {
36 self::$instances[ $module_id ] = new $module( ...$args );
37 }
38
39 return self::$instances[ $module_id ];
40 }
41
42 protected function database( $args = null ) {
43 return new Storage( $args );
44 }
45 }