-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
35 lines (30 loc) · 913 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
<?php
define('DEV', WP_ENV == 'development');
require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/vendor/pryley/castor-framework/castor.php';
/**
* Setup theme
* @return void
*/
add_action('after_setup_theme', function () {
// Google Analytics
if (Development::isProduction() && $analyticsId = SiteMeta::services('google_analytics')) {
add_theme_support('soil-google-analytics', $analyticsId, 'wp_footer');
}
});
/**
* Disable Black Bar for non-administrators
* @return bool
*/
add_filter('blackbar/enabled', function () {
return !Development::isProduction() || current_user_can('administrator');
});
/**
* Disable two-factor auth for development and staging environments
* @return string|null
*/
add_filter('two_factor_primary_provider_for_user', function ($provider) {
return Development::isProduction()
? $provider
: 'disable_2fa';
});