This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunctions.php
48 lines (40 loc) · 1.7 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
<?php
// =======================================================================//
// Frontend Includes
// =======================================================================//
$frontend_includes = array(
'assets/php/init.php',
'assets/php/cleanup.php',
'assets/php/scripts.php',
'assets/php/theme_functions.php',
'assets/php/theme_options.php',
'assets/php/bootstrap_embed_responsive.php',
'assets/external/wp-bootstrap-navwalker/wp_bootstrap_navwalker.php',
);
foreach ( $frontend_includes as $file ) {
if ( ! $filepath = locate_template( $file ) ) {
trigger_error( sprintf( esc_html_x( 'Error locating %s for inclusion', '%s contains path to file.', 'ogdch' ), esc_html( $file ) ), E_USER_ERROR );
}
require_once $filepath;
}
unset( $file, $filepath );
// =======================================================================//
// Only Backend Includes
// =======================================================================//
if ( is_admin() ) {
$backend_includes = array(
'assets/php/backend/scripts.php', // Admin Scripts / CSS
'assets/php/backend/caps.php', // Caps & Roles
'assets/php/backend/cpt_messages.php', // Custom post type messages
'assets/php/backend/menu.php', // Menu
'assets/php/backend/statistics.php', // Statistics API
'assets/php/backend/wysiwyg.php', // TinyMCE Configuration
);
foreach ( $backend_includes as $file ) {
if ( ! $filepath = locate_template( $file ) ) {
trigger_error( sprintf( esc_html_x( 'Error locating %s for inclusion', '%s contains path to file.', 'ogdch' ), esc_html( $file ) ), E_USER_ERROR );
}
require_once $filepath;
}
unset( $file, $filepath );
}