-
Notifications
You must be signed in to change notification settings - Fork 0
/
maera-bootstrap.php
executable file
·179 lines (146 loc) · 4.7 KB
/
maera-bootstrap.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/*
Plugin Name: Maera Bootstrap Shell
Plugin URI: https://wpsatchel.com/downloads/maera-bootstrap-shell/
Description: Adds the bootstrap shell to the Maera theme
Version: 1.0.1
Author: WPSatchel
Contributers: Aristeides Stathopoulos, Dimitris Kalliris
Author URI: https://wpsatchel.com
Text Domain: maera_bs
*/
define( 'MAERA_BS_SHELL_VER', '1.0.1' );
define( 'MAERA_BS_SHELL_URL', plugins_url( '', __FILE__ ) );
define( 'MAERA_BS_SHELL_PATH', dirname( __FILE__ ) );
/**
* Include the shell
*/
function maera_shell_bootstrap_include( $shells ) {
// Add our shell to the array of available shells
$shells[] = array(
'value' => 'bootstrap',
'label' => 'Bootstrap',
'class' => 'Maera_BS',
);
return $shells;
}
add_filter( 'maera/shells/available', 'maera_shell_bootstrap_include' );
/**
* Plugin textdomains
*/
function maera_bootstrap_texdomain() {
$lang_dir = get_template_directory() . '/languages';
$custom_path = WP_LANG_DIR . '/maera-' . get_locale() . '.mo';
if ( file_exists( $custom_path ) ) {
load_textdomain( 'maera_bs', $custom_path );
} else {
load_plugin_textdomain( 'maera_bs', false, $lang_dir );
}
}
add_action( 'plugins_loaded', 'maera_bootstrap_texdomain' );
if ( ! class_exists( 'Maera_BS' ) ) {
/**
* The Bootstrap Shell module
*/
class Maera_BS {
private static $instance;
/**
* Class constructor
*/
public function __construct() {
if ( ! defined( 'MAERA_SHELL_PATH' ) ) {
define( 'MAERA_SHELL_PATH', dirname( __FILE__ ) );
}
add_action( 'after_setup_theme', array( $this, 'theme_supports' ) );
// Include other classes
include_once( MAERA_SHELL_PATH . '/includes/class-tgm-plugin-activation.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-widget-dropdown.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-widgets.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-styles.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-structure.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-compiler.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-images.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-excerpt.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-scripts.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-meta.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-layout.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-navbar.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-social.php' );
include_once( MAERA_SHELL_PATH . '/includes/variables.php' );
include_once( MAERA_SHELL_PATH . '/includes/class-maera-bs-timber.php' );
// Include the customizer
include_once( MAERA_SHELL_PATH . '/customizer.php' );
// Instantianate addon classes
$bs_structure = new Maera_BS_Structure();
$bs_widgets = new Maera_BS_Widgets();
$bs_styles = new Maera_BS_Styles();
$bs_compiler = new Maera_BS_Compiler();
$bs_images = new Maera_BS_Images();
$bs_excerpt = new Maera_BS_Excerpt();
$bs_timber = new Maera_BS_Timber();
$bs_scripts = new Maera_BS_Scripts();
$bs_layout = new Maera_BS_Layout();
$bs_navbar = new Maera_BS_Navbar();
$bs_social = new Maera_BS_Social();
}
/**
* Singleton
*/
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Add theme supports
*/
function theme_supports() {
add_theme_support( 'kirki' );
add_theme_support( 'maera_image' );
add_theme_support( 'maera_color' );
add_theme_support( 'less_compiler' );
}
}
}
/**
* Build the array of required plugins.
* Uses TGMPA
*/
function maera_bs_required_plugins() {
$plugins = array(
array(
'name' => 'Breadcrumb Trail',
'slug' => 'breadcrumb-trail',
'required' => true,
),
array(
'name' => 'Less compilers',
'slug' => 'lessphp',
'required' => true,
),
array(
'name' => 'Timber Library',
'slug' => 'timber-library',
'required' => true,
),
array(
'name' => 'Kirki Toolkit',
'slug' => 'kirki',
'required' => true,
),
);
$config = array(
'id' => 'maera-bootstrap',
'menu' => 'maera-bootstrap-install-plugins',
'parent_slug' => 'themes.php',
'capability' => 'edit_theme_options',
'has_notices' => true,
'dismissable' => false,
'dismiss_msg' => '',
'is_automatic' => true,
'message' => '',
);
tgmpa( $plugins, $config );
}
add_action( 'tgmpa_register', 'maera_bs_required_plugins' );