-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
59 lines (50 loc) · 1.22 KB
/
functions.php
File metadata and controls
59 lines (50 loc) · 1.22 KB
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
<?php
/**
* Eckode theme functions file
*
* @package Eckode
*/
namespace Eckode;
/**
* Constants
*/
// Runtime
define(__NAMESPACE__ . '\URL', trailingslashit(get_template_directory_uri()));
// Compile-time
const VER = '0.0.1';
const PATH = __DIR__ . '/';
/**
* Auto-load classes
*/
if (file_exists(PATH . 'vendor/autoload.php')) {
require(PATH . 'vendor/autoload.php');
} else {
try {
\spl_autoload_register(function ($class) {
/** Only auto-load from within this directory */
if (false === stripos($class, __NAMESPACE__)) {
return;
}
$file_path = PATH . 'inc/classes/' . str_ireplace(__NAMESPACE__ . '\\', '', $class) . '.php';
$file_path = str_replace('\\', DIRECTORY_SEPARATOR, $file_path);
if (file_exists($file_path)) {
include_once($file_path);
}
});
} catch (\Exception $e) {
}
}
/**
* Utility/helper functions
*/
include_once PATH . 'inc/constants.php';
include_once PATH . 'inc/utils/boot.php';
include_once PATH . 'inc/utils/structures.php';
include_once PATH . 'inc/utils/enqueue.php';
include_once PATH . 'inc/utils/menu.php';
include_once PATH . 'inc/utils/rest.php';
/**
* Hooks last
*/
include_once PATH . 'inc/hooks/assets.php';
include_once PATH . 'inc/hooks/init.php';