-
Notifications
You must be signed in to change notification settings - Fork 5
/
functions.php
44 lines (38 loc) · 1.08 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
<?php
/**
* WDS BT functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package wdsbt
* @author WebDevStudios
* @license GNU General Public License v3
*/
namespace WebDevStudios\wdsbt;
// Define a global path and url.
define( 'WebDevStudios\wdsbt\ROOT_PATH', trailingslashit( get_template_directory() ) );
define( 'WebDevStudios\wdsbt\ROOT_URL', trailingslashit( get_template_directory_uri() ) );
/**
* Get all the include files for the theme.
*
* @author WebDevStudios
*/
function include_inc_files() {
$files = [
'inc/functions/', // Custom functions that act independently of the theme templates.
'inc/hooks/', // Load custom filters and hooks.
'inc/setup/', // Theme setup.
];
foreach ( $files as $include ) {
$include = trailingslashit( get_template_directory() ) . $include;
// Allows inclusion of individual files or all .php files in a directory.
if ( is_dir( $include ) ) {
foreach ( glob( $include . '*.php' ) as $file ) {
require $file;
}
} else {
require $include;
}
}
}
include_inc_files();