forked from WebDevStudios/BuddyPress-Registration-Options
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bp-registration-options.php
87 lines (75 loc) · 2 KB
/
bp-registration-options.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
<?php
/**
* BP-Registration-Options Core Real Initialization.
*
* @package BP-Registration-Options
*/
/**
* Does all the actual loading.
*/
class BP_Registration_Options {
/**
* Current version.
*
* @since unknown
* @var string
*/
public $version = '';
/**
* Plugin basename.
*
* @since unknown
* @var string
*/
public $basename = '';
/**
* Plugin directory server path.
*
* @since unknown
* @var string
*/
public $directory_path = '';
/**
* Piece it all together
*/
function __construct() {
// Define plugin constants.
$this->version = BP_REGISTRATION_OPTIONS_VERSION;
$this->basename = plugin_basename( __FILE__ );
$this->directory_path = plugin_dir_path( __FILE__ );
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
register_deactivation_hook( __FILE__, array( &$this, 'deactivate' ) );
require_once( $this->directory_path . 'includes/utility.php' );
require_once( $this->directory_path . 'includes/admin.php' );
require_once( $this->directory_path . 'includes/core.php' );
require_once( $this->directory_path . 'includes/compatibility.php' );
require_once( $this->directory_path . 'includes/emails.php' );
// add email actions
$bpr_emails = new BP_Registration_Emails();
$bpr_emails->add_actions();
add_action( 'init', array( $this, 'load_textdomain' ) );
}
/**
* Activation hook for the plugin.
*/
function activate() {
// Verify user is running WP 3.0 or newer.
if ( version_compare( get_bloginfo( 'version' ), '3.0', '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( esc_html__( 'This plugin requires WordPress version 3.0 or higher.', 'bp-registration-options' ) );
}
flush_rewrite_rules();
}
/**
* Deactivation hook for the plugin.
*/
function deactivate() {
flush_rewrite_rules();
}
/**
* Load our textdomain
*/
function load_textdomain() {
load_plugin_textdomain( 'bp-registration-options', false, basename( dirname( __FILE__ ) ) . '/languages/' );
}
}