forked from gad2103/shoestrap
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunctions.php
63 lines (51 loc) · 1.82 KB
/
functions.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
<?php
/**
* The Maera class autoloader.
* Finds the path to a class that we're requiring and includes the file.
*/
function maera_autoload_classes( $class_name ) {
if ( class_exists( $class_name ) ) {
return;
}
$class_path = get_template_directory() . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
if ( file_exists( $class_path ) ) {
include $class_path;
}
}
// Run the autoloader
spl_autoload_register( 'maera_autoload_classes' );
require_once( locate_template( '/includes/template-hierarchy.php' ) );
require_once( locate_template( '/includes/utils.php' ) );
require_once( locate_template( '/includes/widgets.php' ) );
require_once( locate_template( '/includes/remote-installer/client.php' ) );
/**
* If Kirki is not installed as a plugin include the embedded Version
*/
if ( ! class_exists( 'Kirki' ) && ! is_admin() ) {
define( 'KIRKI_PATH', get_template_directory() . '/includes/plugins/kirki' );
define( 'KIRKI_URL', get_template_directory_uri() . '/includes/plugins/kirki' );
require_once( get_template_directory() . '/includes/plugins/kirki/kirki.php' );
}
/**
* If Timber is not installed as a plugin include the embedded version.
*/
if ( ! class_exists( 'Timber' ) && ! is_admin() ) {
require_once( get_template_directory() . '/includes/plugins/timber-library/timber.php' );
}
/**
* Dummy function to prevent fatal errors with the Tonesque library
* Only used when Jetpack is not installed.
*/
if ( ! function_exists( 'jetpack_require_lib' ) && ! is_admin() ) {
function jetpack_require_lib() {}
}
function Maera() {
return Maera::get_instance();
}
// Global
$GLOBALS['maera'] = maera();
global $maera;
// Load our Maera_EDD class if EDD is installed
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
Maera_EDD::get_instance();
}