-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-playground-blueprint-editor.php
110 lines (94 loc) · 2.75 KB
/
wp-playground-blueprint-editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Plugin Name: Playground blueprint editor
* Description: Design playground blueprints with a specialized block editor interface in WordPress.
* Version: 1.0.0
* Requires PHP: 7.4
* Author: Lubus
* Author URI: https://lubus.in/
* Contributor: Lubus, https://lubus.in/
* Text Domain: wp-playground-blueprint-editor
*
* @package wp-playground-blueprint-editor
*/
namespace WP\PlaygroundBlueprintEditor;
use WP\Admin\PlaygroundBlueprintEditor\{
BlueprintPostType,
BlueprintSteps,
EnqueueScripts,
RegisterCustomMeta
};
defined('ABSPATH') || exit;
require_once 'vendor/autoload.php';
require_once 'inc/functions.php';
if (!class_exists('PlaygroundBlueprintEditor')) {
/**
* Playground blueprint editor Main Class
*/
class PlaygroundBlueprintEditor
{
/**
* The single instance of the class.
*
* @var PlaygroundBlueprintEditor
*/
protected static $_instance = null;
/**
* Singleton instance method.
*
* @return self
*/
public static function instance()
{
if (is_null(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Constructor to initialize the plugin.
*/
public function __construct()
{
$this->setup_constants();
$this->bootstrap();
}
/**
* Setup plugin constants.
*/
private function setup_constants()
{
// Plugin version.
if (!defined('BEPB_VERSION')) {
define('BEPB_VERSION', '0.1.0');
}
// Plugin Root File.
if (!defined('BEPB_PLUGIN_FILE')) {
define('BEPB_PLUGIN_FILE', __FILE__);
}
// Plugin Folder Path.
if (!defined('BEPB_PLUGIN_DIR')) {
define('BEPB_PLUGIN_DIR', plugin_dir_path(BEPB_PLUGIN_FILE));
}
// Plugin Folder URL.
if (!defined('BEPB_PLUGIN_URL')) {
define('BEPB_PLUGIN_URL', plugin_dir_url(BEPB_PLUGIN_FILE));
}
// Plugin Basename aka: "block-editor-for-playground-blueprint/wp-playground-blueprint-editor.php".
if (!defined('BEPB_PLUGIN_BASENAME')) {
define('BEPB_PLUGIN_BASENAME', plugin_basename(BEPB_PLUGIN_FILE));
}
}
/**
* Bootstraps the plugin.
*/
private function bootstrap()
{
new EnqueueScripts();
new BlueprintPostType();
new BlueprintSteps();
new RegisterCustomMeta();
}
}
}
return PlaygroundBlueprintEditor::instance();