PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 2.3.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v2.3.5
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 / admin / wp-notice / Utils / Base.php

Base.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 2.3.5, at admin/wp-notice/Utils/Base.php

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