-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
executable file
·51 lines (43 loc) · 1.68 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
49
50
51
<?php
/**
* WP Theme constants and setup functions
*
* @package By40QTheme
*/
// Useful global constants.
define('BY40Q_THEME_VERSION', '0.1.0');
define('BY40Q_THEME_TEMPLATE_URL', get_template_directory_uri());
define('BY40Q_THEME_PATH', get_template_directory() . '/');
define('BY40Q_THEME_DIST_PATH', BY40Q_THEME_PATH . 'public/');
define('BY40Q_THEME_DIST_URL', BY40Q_THEME_TEMPLATE_URL . '/public/');
define('BY40Q_THEME_INC', BY40Q_THEME_PATH . 'includes/');
define('BY40Q_THEME_BLOCK_DIR', BY40Q_THEME_PATH . 'resources/views/blocks/');
define('BY40Q_THEME_COMPONENTS_DIR', BY40Q_THEME_PATH . 'resources/views/components/');
define('BY40Q_THEME_BLOCK_DIST_DIR', BY40Q_THEME_PATH . 'dist/blocks/');
$is_local_env = in_array(wp_get_environment_type(), ['local', 'development'], true);
$is_local_url = strpos(home_url(), '.test') || strpos(home_url(), '.local');
$is_local = $is_local_env || $is_local_url;
require_once BY40Q_THEME_INC . 'core.php';
require_once BY40Q_THEME_INC . 'overrides.php';
require_once BY40Q_THEME_INC . 'template-tags.php';
require_once BY40Q_THEME_INC . 'utility.php';
require_once BY40Q_THEME_INC . 'blocks-register.php';
require_once BY40Q_THEME_INC . 'helpers.php';
require_once BY40Q_THEME_INC . 'acf.php';
require_once BY40Q_THEME_INC . 'acf-filters.php';
// Run the setup functions.
By40QTheme\Core\setup();
By40QTheme\BlocksRegister\setup();
// Require Composer autoloader if it exists.
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
if (!function_exists('wp_body_open')) {
/**
* Shim for the new wp_body_open() function that was added in 5.2
*/
function wp_body_open()
{
do_action('wp_body_open');
}
}