-
Notifications
You must be signed in to change notification settings - Fork 7
/
bootstrap.php
53 lines (44 loc) · 1.46 KB
/
bootstrap.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
<?php
/**
* Set up config object, store plugin URL and path there
* along with various other items
*/
\Codelight\GDPR\Container::getInstance()->bindIf('config', function () {
return new \Codelight\GDPR\Config([
'plugin' => [
'url' => plugin_dir_url(__FILE__),
'path' => plugin_dir_path(__FILE__),
'template_path' => plugin_dir_path(__FILE__) . 'views/',
],
'help' => [
'url' => 'https://codelight.eu/wordpress-gdpr-framework/',
],
]);
}, true);
/**
* Set up the application container
*
* @param string $abstract
* @param array $parameters
* @param Codelight\GDPR\Container $container
*
* @return Codelight\GDPR\Container|mixed
*/
function gdpr($abstract = null, $parameters = [], Codelight\GDPR\Container $container = null)
{
$container = $container ?: Codelight\GDPR\Container::getInstance();
if ( ! $abstract) {
return $container;
}
return $container->bound($abstract)
? $container->makeWith($abstract, $parameters)
: $container->makeWith("gdpr.{$abstract}", $parameters);
}
/**
* Start the plugin on plugins_loaded at priority 0.
*/
add_action('plugins_loaded', function () use ($gdpr_error) {
load_plugin_textdomain('gdpr-framework', false, basename( dirname( __FILE__ ) ) . '/languages/');
new \Codelight\GDPR\Updater\Updater();
new \Codelight\GDPR\Setup();
}, 0);