-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaz-sage-extras-bootstrap.php
49 lines (39 loc) · 1.71 KB
/
az-sage-extras-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
<?php
/**
* @file bootstrap.php
*
* Hooks up all required files to the stock Sage theme
*/
// Extras
$extra_includes = [
'az-sage-extras/lib/setup.php', // Debugging helpers
'az-sage-extras/lib/extras.php', // Extra helpers
'az-sage-extras/lib/debug.php', // Debugging helpers
'az-sage-extras/lib/featured.php', // Working with featured images
'az-sage-extras/lib/logo.php', // Working with custom logo
'az-sage-extras/lib/cache.php', // Functionality related to caching
'az-sage-extras/lib/page-theme.php', // Functionality related to page theme
'az-sage-extras/lib/customizer/palette.php', // Include palette Customizer section
'az-sage-extras/lib/customizer/copyright.php', // Include copyright Customizer section
'az-sage-extras/lib/customizer/errors.php', // Include errors settings
'az-sage-extras/lib/customizer/cache.php', // Include cache settings
'az-sage-extras/vendor/include-kirki.php', // Include Kirki plugin
'az-elements/widgets.php', // Include registration of widgets
];
// Load all elements' Customizer settings
$elements = scandir( __DIR__ . '/../az-elements' );
foreach ( $elements as $element ) {
if ( !in_array( $element, [ '.', '..' ] ) ) {
$customizer_settings_file = '/az-elements/' . $element . '/customizer/' . $element . '.php';
if ( file_exists( __DIR__ . '/..' . $customizer_settings_file ) ) {
$extra_includes[] = $customizer_settings_file;
}
}
}
foreach ( $extra_includes as $file ) {
if ( ! $filepath = locate_template( $file ) ) {
// trigger_error( sprintf( __( 'Error locating %s for inclusion', 'sage' ), $file ), E_USER_ERROR );
}
require_once $filepath;
}
unset( $file, $filepath );