PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.2
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.2
3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 All 157 releases
notificationx / vendor / priyomukul / wp-notice / src / Utils / Base.php

Base.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.3.2, 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 }