-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcarelib.php
214 lines (195 loc) · 5.96 KB
/
carelib.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
/**
* Load all required library files.
*
* @package CareLib
* @copyright Copyright (c) 2018, Cipher Development, LLC
* @license GPL-2.0+
* @since 1.0.0
*/
defined( 'ABSPATH' ) || exit;
/**
* The current version of CareLib.
*
* @since 1.0.0
*/
define( 'CARELIB_VERSION', '2.2.1' );
/**
* The absolute path to CareLib's root directory with a trailing slash.
*
* @since 1.0.0
* @uses get_template_directory()
* @uses trailingslashit()
*/
define( 'CARELIB_DIR', trailingslashit( dirname( __FILE__ ) ) );
if ( ! defined( 'PARENT_THEME_DIR' ) ) {
/**
* The absolute path to the template's root directory with a trailing slash.
*
* @since 1.0.0
* @uses get_template_directory()
* @uses trailingslashit()
*/
define( 'PARENT_THEME_DIR', trailingslashit( get_template_directory() ) );
}
if ( ! defined( 'PARENT_THEME_URI' ) ) {
/**
* The absolute path to the template's root directory with a trailing slash.
*
* @since 1.0.0
* @uses get_template_directory_uri()
* @uses trailingslashit()
*/
define( 'PARENT_THEME_URI', trailingslashit( get_template_directory_uri() ) );
}
if ( ! defined( 'CHILD_THEME_DIR' ) ) {
/**
* The absolute path to the template's root directory with a trailing slash.
*
* @since 1.0.0
* @uses get_stylesheet_directory()
* @uses trailingslashit()
*/
define( 'CHILD_THEME_DIR', trailingslashit( get_stylesheet_directory() ) );
}
if ( ! defined( 'PARENT_THEME_URI' ) ) {
/**
* The absolute path to the template's root directory with a trailing slash.
*
* @since 1.0.0
* @uses get_stylesheet_directory_uri()
* @uses trailingslashit()
*/
define( 'CHILD_THEME_URI', trailingslashit( get_stylesheet_directory_uri() ) );
}
/**
* The global used to store all layout objects.
*
* @since 1.0.0
*/
if ( ! isset( $GLOBALS['_carelib_layouts'] ) ) {
$GLOBALS['_carelib_layouts'] = array();
}
require_once CARELIB_DIR . 'includes/attributes.php';
require_once CARELIB_DIR . 'includes/breadcrumbs.php';
require_once CARELIB_DIR . 'includes/context.php';
require_once CARELIB_DIR . 'includes/head.php';
require_once CARELIB_DIR . 'includes/image.php';
require_once CARELIB_DIR . 'includes/language.php';
require_once CARELIB_DIR . 'includes/layouts.php';
require_once CARELIB_DIR . 'includes/menu.php';
require_once CARELIB_DIR . 'includes/paths.php';
require_once CARELIB_DIR . 'includes/plugins.php';
require_once CARELIB_DIR . 'includes/scripts.php';
require_once CARELIB_DIR . 'includes/search-form.php';
require_once CARELIB_DIR . 'includes/sidebar.php';
require_once CARELIB_DIR . 'includes/styles.php';
require_once CARELIB_DIR . 'includes/support.php';
require_once CARELIB_DIR . 'includes/template-404.php';
require_once CARELIB_DIR . 'includes/template-archive.php';
require_once CARELIB_DIR . 'includes/template-attachment.php';
require_once CARELIB_DIR . 'includes/template-comments.php';
require_once CARELIB_DIR . 'includes/template-entry.php';
require_once CARELIB_DIR . 'includes/template-global.php';
require_once CARELIB_DIR . 'includes/template-hooks.php';
require_once CARELIB_DIR . 'includes/template-load.php';
require_once CARELIB_DIR . 'includes/theme.php';
require_once CARELIB_DIR . 'admin/layouts.php';
require_once CARELIB_DIR . 'admin/metabox-post-layouts.php';
require_once CARELIB_DIR . 'admin/scripts.php';
require_once CARELIB_DIR . 'admin/styles.php';
if ( carelib_is_woocommerce_active() ) {
require_once CARELIB_DIR . 'includes/woocommerce/template-global.php';
require_once CARELIB_DIR . 'includes/woocommerce/template-hooks.php';
}
add_action( 'after_setup_theme', 'carelib_init', -95 );
/**
* Load and initialize all library functionality.
*
* @since 1.0.0
* @access public
* @return void
*/
function carelib_init() {
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_before_init' );
require_once CARELIB_DIR . 'includes/actions.php';
require_once CARELIB_DIR . 'includes/filters.php';
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_after_init' );
}
add_action( 'after_setup_theme', 'carelib_admin_init', -95 );
/**
* Load and initialize all library functionality.
*
* @since 1.0.0
* @access public
* @return void
*/
function carelib_admin_init() {
if ( is_admin() ) {
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_admin_before_init' );
require_once CARELIB_DIR . 'admin/actions.php';
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_admin_after_init' );
}
}
add_action( 'after_setup_theme', 'carelib_customize_init', -95 );
/**
* Load and initialize all library functionality.
*
* @since 1.0.0
* @access public
* @return void
*/
function carelib_customize_init() {
if ( is_customize_preview() ) {
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_customize_before_init' );
require_once CARELIB_DIR . 'customize/control-radio-image.php';
require_once CARELIB_DIR . 'customize/control-layout.php';
require_once CARELIB_DIR . 'customize/register.php';
require_once CARELIB_DIR . 'customize/scripts.php';
require_once CARELIB_DIR . 'customize/styles.php';
require_once CARELIB_DIR . 'customize/actions.php';
/**
* Provide reliable access to the library's functions before the global
* actions, filters, and classes are initialized.
*
* @since 1.0.0
* @access public
*/
do_action( 'carelib_customize_after_init' );
}
}