/
open-badges-framework.php
104 lines (92 loc) · 3.4 KB
/
open-badges-framework.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link www.badges4languages.com
* @since 0.6.3
* @package OpenBadgesFramework
*
* @wordpress-plugin
* Plugin Name: Open Badges Framework
* Plugin URI: www.badges4languages.com
* Description: Open Badges Framework allows you to distribute and receive certifications of level language skills.
* area.
* Version: 1.1
* Author: My language skills team
* Author URI: www.badges4languages.com
* License: GPL-3.0
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: open-badges-framework
* Domain Path: /languages
*/
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// If this file is called directly, abort!
defined('ABSPATH') or die('Hey, what are you doing here? You silly human!');
// Require once the Composer Autoload
if (file_exists(dirname(__FILE__) . '/vendor/autoload.php')) {
require_once dirname(__FILE__) . '/vendor/autoload.php';
}
// Define CONSTANTS
define( 'PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'PLUGIN', plugin_basename( __FILE__ ) );
/**
* The code that runs during plugin activation
*
* @since 1.0.0
*/
function open_badges_framework_activation() {
Inc\Base\Activate::activate();
}
register_activation_hook(__FILE__, 'open_badges_framework_activation');
/**
* This piece of code loads the text domain.
* It is used for internationalization purposes.
* It should be executed before the rest of the plugin is loaded, so all the strings of the plugin
* are internationalized
*/
function my_plugin_load_plugin_textdomain() {
load_plugin_textdomain( 'open-badges-framework', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action( 'init', 'my_plugin_load_plugin_textdomain' );
/**
* The code that runs during plugin deactivation
*
* @since 1.0.0
*/
function open_badges_framework_deactivation() {
Inc\Base\Deactivate::deactivate();
}
register_deactivation_hook(__FILE__, 'open_badges_framework_deactivation');
/**
* Initialize all the core classes of the plugin
*
* @since 1.0.0
*/
if (class_exists('Inc\\Init')) {
Inc\Init::register_services();
}
/**
* Add custom fields for registration form and profile editor
* Add custom WP Personal Data Exporter
* @since 1.0.1
*/
require_once( "inc/Integrations/RCP-registration_fields.php" );
require_once( "inc/Integrations/wp-user-custom_fields.php" );
require_once( "inc/Integrations/wp_custom_data_exporter.php" );