-
Notifications
You must be signed in to change notification settings - Fork 5
/
functions.php
60 lines (50 loc) · 2.15 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
52
53
54
55
56
57
58
59
60
<?php
/**
* CTCL election template functions and definitions
*
* @package CTCL\Elections
* @since 1.0.0
*/
// Global constants.
define( 'THEME_VERSION', '0.12.2' );
if ( ! defined( 'WP_ENVIRONMENT_TYPE' ) ) {
$host = filter_input( INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_ENCODED );
if ( substr( $host, -strlen( '.test' ) ) === '.test' ) {
define( 'WP_ENVIRONMENT_TYPE', 'local' );
} elseif ( substr( $host, -strlen( '.dev' ) ) === '.dev' ) {
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
}
}
if ( ! isset( $content_width ) ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
$content_width = 944;
}
// Helpers.
require_once __DIR__ . '/includes/class-activation.php';
require_once __DIR__ . '/includes/class-helpers.php';
require_once __DIR__ . '/includes/class-hooks.php';
require_once __DIR__ . '/includes/class-office-details.php';
require_once __DIR__ . '/includes/class-topics.php';
// Theme updater.
require_once __DIR__ . '/includes/class-updater.php';
// Banners.
require_once __DIR__ . '/includes/class-banner.php';
require_once __DIR__ . '/includes/class-alert-banner.php';
// Blocks.
require_once __DIR__ . '/includes/blocks/class-blocks.php';
require_once __DIR__ . '/includes/blocks/class-contact-form.php';
require_once __DIR__ . '/includes/blocks/class-office-info.php';
require_once __DIR__ . '/includes/blocks/class-tile.php';
// Settings.
require_once __DIR__ . '/includes/settings/class-settings.php';
require_once __DIR__ . '/includes/settings/class-elections-settings.php';
require_once __DIR__ . '/includes/settings/class-audience-settings.php';
require_once __DIR__ . '/includes/settings/class-office-details-settings.php';
require_once __DIR__ . '/includes/settings/class-banner-settings.php';
require_once __DIR__ . '/includes/settings/class-topics-settings.php';
require_once __DIR__ . '/includes/settings/class-google-settings.php';
// Google integration.
require_once __DIR__ . '/includes/class-google-analytics.php';
require_once __DIR__ . '/includes/class-google-recaptcha.php'; // Must be after settings page.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once __DIR__ . '/includes/class-ctcl-cli.php';
}