-
Notifications
You must be signed in to change notification settings - Fork 84
/
functions.php
32 lines (25 loc) · 1.21 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
<?php
namespace Flynt;
use Flynt\Utils\FileLoader;
require_once __DIR__ . '/vendor/autoload.php';
if (!defined('WP_ENV')) {
define('WP_ENV', function_exists('wp_get_environment_type') ? wp_get_environment_type() : 'production');
} elseif (!defined('WP_ENVIRONMENT_TYPE')) {
define('WP_ENVIRONMENT_TYPE', WP_ENV);
}
// Check if the required plugins are installed and activated.
// If they aren't, this function redirects the template rendering to use
// plugin-inactive.php instead and shows a warning in the admin backend.
if (Init::checkRequiredPlugins()) {
FileLoader::loadPhpFiles('inc');
add_action('after_setup_theme', [\Flynt\Init::class, 'initTheme']);
add_action('after_setup_theme', [\Flynt\Init::class, 'loadComponents'], 101);
}
// Remove the admin-bar inline-CSS as it isn't compatible with the sticky footer CSS.
// This prevents unintended scrolling on pages with few content, when logged in.
add_theme_support('admin-bar', ['callback' => '__return_false']);
add_action('after_setup_theme', function (): void {
// Make theme available for translation.
// Translations can be filed in the /languages/ directory.
load_theme_textdomain('flynt', get_template_directory() . '/languages');
});