-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwpmudev-plugin-test.php
executable file
·121 lines (100 loc) · 2.72 KB
/
wpmudev-plugin-test.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
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* Plugin Name: WPMU DEV Plugin Test
* Description: A plugin focused on testing coding skills.
* Requires at least: 6.1
* Requires PHP: 7.4
* Version: 0.1.0
* Author: Balakrishnan D
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wpmudev-plugin-test
*
* @package create-block
*/
namespace WPMUDEV\PluginTest;
use WPMUDEV\PluginTest\App\Admin_Pages\Post_Maintenance;
use WPMUDEV\PluginTest\Core\Loader;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// Support for site-level autoloading.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
// Plugin version.
if ( ! defined( 'WPMUDEV_PLUGINTEST_VERSION' ) ) {
define( 'WPMUDEV_PLUGINTEST_VERSION', '1.0.0' );
}
// Define WPMUDEV_PLUGINTEST_PLUGIN_FILE.
if ( ! defined( 'WPMUDEV_PLUGINTEST_PLUGIN_FILE' ) ) {
define( 'WPMUDEV_PLUGINTEST_PLUGIN_FILE', __FILE__ );
}
// Plugin directory.
if ( ! defined( 'WPMUDEV_PLUGINTEST_DIR' ) ) {
define( 'WPMUDEV_PLUGINTEST_DIR', plugin_dir_path( __FILE__ ) );
}
// Plugin url.
if ( ! defined( 'WPMUDEV_PLUGINTEST_URL' ) ) {
define( 'WPMUDEV_PLUGINTEST_URL', plugin_dir_url( __FILE__ ) );
}
// Assets url.
if ( ! defined( 'WPMUDEV_PLUGINTEST_ASSETS_URL' ) ) {
define( 'WPMUDEV_PLUGINTEST_ASSETS_URL', WPMUDEV_PLUGINTEST_URL . '/assets' );
}
// Shared UI Version.
if ( ! defined( 'WPMUDEV_PLUGINTEST_SUI_VERSION' ) ) {
define( 'WPMUDEV_PLUGINTEST_SUI_VERSION', '2.12.23' );
}
if ( !defined( 'WPMUDEV_PLUGINTEST_SETTINGS')){
define( 'WPMUDEV_PLUGINTEST_SETTINGS', 'wpmudev_plugin_test_settings' );
}
/**
* WPMUDEV_PluginTest class.
*/
class WPMUDEV_PluginTest {
/**
* Holds the class instance.
*
* @var WPMUDEV_PluginTest $instance
*/
private static $instance = null;
/**
* Return an instance of the class
*
* Return an instance of the WPMUDEV_PluginTest Class.
*
* @return WPMUDEV_PluginTest class instance.
* @since 1.0.0
*
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Class initializer.
*/
public function load() {
load_plugin_textdomain(
'wpmudev-plugin-test',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
Loader::instance();
//WPMUDEV\PluginTest\Core\Loader::instance();
}
}
// Init the plugin and load the plugin instance for the first time.
add_action(
'plugins_loaded',
function () {
WPMUDEV_PluginTest::get_instance()->load();
}
);
//function login_by_google() {
// register_block_type( __DIR__ . '/build' );
//}
//add_action( 'init', 'login_by_google' );