PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / vendor / priyomukul / wp-notice / src / Utils / Base.php

Base.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.9, 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 }