PluginProbe
The GDPR Framework By Data443 / 1.0.34
The GDPR Framework By Data443 v1.0.34
2.5.0 2.4.0 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.3 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 All 41 releases
gdpr-framework / bootstrap.php

bootstrap.php in The GDPR Framework By Data443 1.0.34, at bootstrap.php

62 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Set up config object, store plugin URL and path there
4 * along with various other items
5 */
6
7 \Codelight\GDPR\Container::getInstance()->bindIf('config', function () {
8 return new \Codelight\GDPR\Config([
9 'plugin' => [
10 'url' => plugin_dir_url(__FILE__),
11 'path' => plugin_dir_path(__FILE__),
12 'template_path' => plugin_dir_path(__FILE__) . 'views/',
13 ],
14 'help' => [
15 'url' => 'https://www.data443.com/gdpr-framework/',
16 ],
17 ]);
18 }, true);
19
20 /**
21 * Set up the application container
22 *
23 * @param string $abstract
24 * @param array $parameters
25 * @param Codelight\GDPR\Container $container
26 *
27 * @return Codelight\GDPR\Container|mixed
28 */
29 function gdpr($abstract = null, $parameters = [], Codelight\GDPR\Container $container = null)
30 {
31 $container = $container ?: Codelight\GDPR\Container::getInstance();
32
33 if ( ! $abstract) {
34 return $container;
35 }
36
37 return $container->bound($abstract)
38 ? $container->makeWith($abstract, $parameters)
39 : $container->makeWith("gdpr.{$abstract}", $parameters);
40 }
41
42 /**
43 * Start the plugin on plugins_loaded at priority 0.
44 */
45 add_action('plugins_loaded', function () use ($gdpr_error) {
46
47 load_plugin_textdomain('gdpr-framework', false, basename( dirname( __FILE__ ) ) . '/languages/');
48
49 $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
50
51 $locale = apply_filters( 'plugin_locale', $locale, 'gdpr-framework' );
52
53 unload_textdomain( 'gdpr-framework' );
54
55 load_textdomain( 'gdpr-framework', get_stylesheet_directory().'/gdpr-framework/languages/'.'gdpr-framework'.'-'.$locale.'.mo' );
56
57 new \Codelight\GDPR\Updater\Updater();
58
59 new \Codelight\GDPR\Setup();
60
61 }, 0);
62