-
Notifications
You must be signed in to change notification settings - Fork 136
/
functions.php
47 lines (41 loc) · 1.24 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
<?php
/**
* WDS wd_s functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package wd_s
*/
namespace WebDevStudios\wd_s;
// Define a global path and url.
define( 'WebDevStudios\wd_s\ROOT_PATH', trailingslashit( get_template_directory() ) );
define( 'WebDevStudios\wd_s\ROOT_URL', trailingslashit( get_template_directory_uri() ) );
/**
* Get all the include files for the theme.
*
* @author WebDevStudios
*/
function include_inc_files() {
$files = [
'inc/customizer/customizer.php', // Customizer additions.
'inc/functions/', // Custom functions that act independently of the theme templates.
'inc/hooks/', // Load custom filters and hooks.
'inc/post-types/', // Load custom post types.
'inc/setup/', // Theme setup.
'inc/shortcodes/', // Load shortcodes.
'inc/template-tags/', // Custom template tags for this theme.
'inc/wpcli/',
];
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();