forked from WebDevStudios/BuddyPress-Registration-Options
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bp-registration-options.php
45 lines (37 loc) · 1.38 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
<?php
class BP_Registration_Options {
function __construct() {
// Define plugin constants
$this->version = BP_REGISTRATION_OPTIONS_VERSION;
$this->basename = plugin_basename( __FILE__ );
$this->directory_path = plugin_dir_path( __FILE__ );
//$this->directory_url = plugins_url( 'bp-registration-options/' );
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
register_deactivation_hook( __FILE__, array( &$this, 'deactivate' ) );
require_once( $this->directory_path . 'includes/admin.php' );
require_once( $this->directory_path . 'includes/core.php' );
require_once( $this->directory_path . 'includes/compatibility.php' );
add_action( 'init', array( $this, 'load_textdomain' ) );
}
/**
* Activation hook for the plugin.
*/
function activate() {
$this->includes();
//verify user is running WP 3.0 or newer
if ( version_compare( get_bloginfo( 'version' ), '3.0', '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate our plugin
wp_die( __( '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();
}
function load_textdomain() {
load_plugin_textdomain( 'bp-registration-options', false, basename( dirname( __FILE__ ) ) . '/languages/' );
}
}