forked from WebDevStudios/BuddyPress-Registration-Options
/
loader.php
70 lines (60 loc) · 2.34 KB
/
loader.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
/*
Plugin Name: BP Registration Options
Plugin URI: http://wordpress.org/plugins/bp-registration-options/
Description: This BuddyPress extension allows you to enable user moderation for new members, as well as help create a private network for your users. If moderation is enabled, any new members will be denied access to your BuddyPress and bbPress areas on your site, with the exception of their own user profile. They will be allowed to edit and configure that much. They will also not be listed in the members lists on the frontend until approved. Custom messages are available so you can tailor them to the tone of your website and community. When an admin approves or denies a user, email notifications will be sent to let them know of the decision.
Version: 4.2.8
Author: Michael Beckwith and Brian Messenlehner of WebDevStudios
Author URI: http://webdevstudios.com/
Licence: GPLv3
Text Domain: bp-registration-options
*/
define( 'BP_REGISTRATION_OPTIONS_VERSION', '4.2.8' );
/**
* Loads BP Registration Options files only if BuddyPress is present
*
* @package BP-Registration-Options
*
*/
function bp_registration_options_init() {
$bp = '';
$bbp = '';
# Not using bp_includes because we want to be able to be run with just bbPress as well.
if ( function_exists( 'buddypress' ) ) {
$bp = buddypress();
}
if ( function_exists( 'bbpress' ) ) {
$bbp = bbpress();
}
if ( bp_registration_should_init( $bp, $bbp ) ) {
require_once( dirname( __FILE__ ) . '/bp-registration-options.php' );
$bp_registration_options = new BP_Registration_Options;
add_action( 'init', 'bp_registration_options_compat_init' );
}
}
add_action( 'plugins_loaded', 'bp_registration_options_init' );
/**
* Loads the BP Registration Options Compatibility features.
*
* @since 4.2.8
*/
function bp_registration_options_compat_init() {
$bp_registration_compatibility = new BP_Registration_Compatibility;
}
/**
* Checks if we should init our settings and code.
*
* @since 4.2.8
*
* @param object|string $bp BuddyPress instance, if available.
* @param object|string $bbp bbPress instance, if available.
*/
function bp_registration_should_init( $bp = '', $bbp = '' ) {
if (
( is_object( $bp ) && version_compare( $bp->version, '1.7.0', '>=' ) ) ||
( is_object( $bbp ) && version_compare( $bbp->version, '2.0.0', '>=' ) )
) {
return true;
}
return false;
}