-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
80 lines (67 loc) · 2.28 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
use UKMNorge\DesignWordpress\Environment\Shortcodes;
use UKMNorge\DesignWordpress\Environment\Admin;
use UKMNorge\DesignWordpress\Environment\Ajax;
use UKMNorge\DesignWordpress\Environment\Redirects;
use UKMNorge\DesignWordpress\Environment\Setup;
use UKMNorge\DesignWordpress\Environment\Wordpress;
use UKMNorge\Geografi\Kommune;
require_once('vendor/autoload.php');
// OpenID Connect Server (plugin: https://github.com/Automattic/wp-openid-connect-server)
add_filter('oidc_registered_clients', 'my_oidc_clients');
function my_oidc_clients() {
return array(
FSS_OIDC_USER => array(
'name' => 'FSS - Festival Styring System',
'secret' => FSS_OIDC_SECRET,
'redirect_uri' => FSS_OIDC_CALLBACK,
'grant_types' => array('authorization_code'),
'scope' => 'openid profile email phone',
),
DELTA_OIDC_USER => array(
'name' => 'UKM Påmeldingssystemet',
'secret' => DELTA_OIDC_SECRET,
'redirect_uri' => DELTA_OIDC_CALLBACK,
'grant_types' => array('authorization_code'),
'scope' => 'openid profile email phone',
),
);
}
add_theme_support( 'post-thumbnails' );
add_theme_support( 'menus' );
/**
* Disable colors
*/
add_theme_support( 'editor-color-palette' );
add_theme_support( 'disable-custom-colors' );
/**
* Disable font sizes.
*/
add_theme_support( 'editor-font-sizes', [] );
add_theme_support( 'disable-custom-font-sizes' );
add_action('init', [Setup::class, 'addRewriteRules']);
if( function_exists('is_admin') && is_admin() ) {
Wordpress::initWithoutTwig();
} else {
Wordpress::init();
}
Ajax::hook();
Admin::hook();
Redirects::hook();
Setup::hook();
Shortcodes::hook();
#Rewrites::hook();
Wordpress::includeTwigJs();
if( isset($_COOKIE['lastlocation'])) {
$kommune = new Kommune($_COOKIE['lastlocation']);
$mitt_ukm = new stdClass();
$mitt_ukm->kommunenummer = $kommune->getId();
$mitt_ukm->fylkesnummer = $kommune->getFylke()->getId();
$mitt_ukm->kommunenavn = $kommune->getNavn();
Wordpress::addViewData('last_location', $mitt_ukm);
}
/**
* @todo Implementer twig-cache?
*/
#WP_TWIG::setCacheDir( $_ENV['HOME'].'/cache/ukmresponsive/');
#WP_TWIG::setDebug( WP_ENV == 'dev' );