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.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 3.5.2 All 199 releases
betterdocs / includes / gutenberg / class-betterdocs-gutenberg.php

class-betterdocs-gutenberg.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 2.3.5, at includes/gutenberg/class-betterdocs-gutenberg.php

61 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly.
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 if (!class_exists('BetterDocsGutenberg')) {
8 class BetterDocsGutenberg
9 {
10
11 protected static $_instance = null;
12
13 public static function get_instance()
14 {
15 if (is_null(self::$_instance)) {
16 self::$_instance = new self();
17 }
18 return self::$_instance;
19 }
20
21 private function __construct()
22 {
23 // Load Admin Files
24 $this->load_admin_dependencies();
25 // Load All Block Files
26 $this->load_block_dependencies();
27 // load Admin Class
28 new BetterDocsGutenbergAdmin();
29 }
30
31 private function load_admin_dependencies()
32 {
33 require_once BETTERDOCS_DIR_PATH . 'includes/gutenberg/class-betterdocs-gutenberg-admin.php';
34 }
35
36 private function load_block_dependencies()
37 {
38 // Categorybox Block
39 require_once BETTERDOCS_DIR_PATH . 'includes/gutenberg/blocks/categorybox.php';
40 require_once BETTERDOCS_DIR_PATH . 'includes/gutenberg/blocks/categorygrid.php';
41 require_once BETTERDOCS_DIR_PATH . 'includes/gutenberg/blocks/searchbox.php';
42 }
43 /**
44 * Generic data fetching wrapper
45 * Uses the WP-API for fetching
46 */
47 public static function betterdocs_wp_remote_get($url)
48 {
49 $request = wp_remote_get($url);
50
51 if (is_wp_error($request)) {
52 return false;
53 }
54
55 return wp_remote_retrieve_body($request);
56 }
57 }
58
59 BetterDocsGutenberg::get_instance();
60 }
61