-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-gdpr-core.php
70 lines (54 loc) · 1.8 KB
/
wp-gdpr-core.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
<?php
/**
* WP GDPR
*
* Help to handle gdpr regulations
*
* @package WP GDPR CORE
* @author AppSaloon
* @license proprietary
* @link https://wp-gdpr.eu
* @copyright 2017 wp-gdpr
*
* @wordpress-plugin
* Plugin Name: WP GDPR
* Description: Help to handle gdpr regulations.
* Version: 1.2.1
* Text Domain: wp_gdpr
* Domain Path: /languages
* Author: AppSaloon
* Author URI: https://www.appsaloon.be
*/
namespace wp_gdpr;
define( 'GDPR_DIR', plugin_dir_path( __FILE__ ) );
define( 'GDPR_URL', plugin_dir_url( __FILE__ ) );
define( 'GDPR_BASE_NAME', dirname( plugin_basename( __FILE__) ) );
require_once GDPR_DIR . 'lib/gdpr-autoloader.php';
//include to register custom table on plugin activation
include_once GDPR_DIR . 'lib/gdpr-customtables.php';
use wp_gdpr\lib\Gdpr_Container;
class Wp_Gdpr_Core {
const FORM_SHORTCODE_NAME = 'REQ_CRED_FORM';
public $request_form_inputs;
public function __construct() {
//list of inputs in request form
$this->request_form_inputs = array(
'email' => 'required',
'gdpr_req' => 'required',
'checkbox_gdpr' => 'required'
);
$this->run();
$this->execute_on_plugin_activation();
}
public function run() {
Gdpr_Container::make( 'wp_gdpr\config\Startup_Config' );
Gdpr_Container::make( 'wp_gdpr\controller\Controller_Credentials_Request', self::FORM_SHORTCODE_NAME );
Gdpr_Container::make( 'wp_gdpr\controller\Controller_Comments' );
Gdpr_Container::make( 'wp_gdpr\controller\Controller_Form_Submit', $this->request_form_inputs );
Gdpr_Container::make( 'wp_gdpr\controller\Controller_Menu_Page' );
}
public function execute_on_plugin_activation() {
register_activation_hook( __FILE__, array( 'wp_gdpr\lib\Gdpr_Customtables', 'create_custom_tables' ) );
}
}
new Wp_Gdpr_Core();