-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathclass-plugin.php
103 lines (80 loc) · 1.67 KB
/
class-plugin.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
<?php
/**
* GoDaddy Reseller Store plugin class.
*
* Main loader for the plugin
*
* @class Reseller_Store/Plugin
* @package Reseller_Store/Plugin
* @category Class
* @author GoDaddy
* @since 1.5.0
*/
namespace Reseller_Store;
use stdClass;
use WP_CLI;
if ( ! defined( 'ABSPATH' ) ) {
// @codeCoverageIgnoreStart
exit;
// @codeCoverageIgnoreEnd
}
final class Plugin {
use Singleton, Data, Helpers;
/**
* Plugin version.
*
* @since 0.2.0
*
* @var string
*/
const VERSION = '2.2.15';
/**
* Plugin prefix.
*
* @since 0.2.0
*
* @var string
*/
const PREFIX = 'rstore_';
/**
* Class contructor.
*
* @since 0.2.0
*/
private function __construct() {
$this->version = self::VERSION;
$this->basename = plugin_basename( __FILE__ );
$this->base_dir = plugin_dir_path( __FILE__ );
$this->assets_url = plugin_dir_url( __FILE__ ) . 'assets/';
$this->api = new API;
add_action(
'plugins_loaded',
function () {
load_plugin_textdomain( 'reseller-store', false, dirname( $this->basename ) . '/languages' );
}
);
if ( defined( 'WP_CLI' ) && WP_CLI ) {
WP_CLI::add_command( 'reseller', __NAMESPACE__ . '\CLI\Reseller' );
WP_CLI::add_command( 'reseller product', __NAMESPACE__ . '\CLI\Reseller_Product' );
}
new Restrictions;
new Post_Type;
new Taxonomy_Category;
new Taxonomy_Tag;
new Settings;
if ( ! rstore_is_setup() || ! rstore_has_products() ) {
new Setup;
return; // Bail until Setup is complete.
}
new Admin_Notices;
new ButterBean;
new Display;
new Embed;
new Permalinks;
new Sync;
new Widgets;
new Shortcodes;
new Blocks;
new Bulk_Restore;
}
}