forked from bcgov/bcgov-wordpress-block-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
46 lines (39 loc) · 989 Bytes
/
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
<?php
/**
* Functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Bcgov/Theme/Block
* @since 1.0.0
*
* @return void
*/
namespace Bcgov\Theme\Block;
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct access denied.' );
}
// Include the Loader and Setup classes.
require_once get_template_directory() . '/src/Loader.php';
require_once get_template_directory() . '/src/Setup.php';
if ( class_exists( 'Bcgov\\Theme\\Block\\Loader' ) ) {
$base_dirs = [
get_template_directory() . '/src',
get_template_directory() . '/inc/core',
];
$loader = new Loader( $base_dirs );
$loader->register();
}
if ( class_exists( 'Bcgov\\Theme\\Block\\Setup' ) ) {
new Setup();
}
/**
* Constants to enable/disable specific site features.
*
* @since 1.0.3
*/
if ( 'cleanbc' === get_option( 'active_site_pattern_styles' ) ) {
define( __NAMESPACE__ . '\CLEANBC', true );
} else {
define( __NAMESPACE__ . '\CLEANBC', false );
}