This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
loader.php
79 lines (65 loc) · 2.55 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
71
72
73
74
75
76
77
78
79
<?php
/**
* WordPress plugin loader file.
*
* @package BP-Registration-Options
*/
/**
* Plugin Name: BP Registration Options
* Plugin URI: https://pluginize.com
* 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.4.2
* Author: Pluginize
* Author URI: https://pluginize.com
* Licence: GPLv3
* Text Domain: bp-registration-options
*/
define( 'BP_REGISTRATION_OPTIONS_VERSION', '4.4.2' );
/**
* Loads BP Registration Options files only if BuddyPress is present.
*/
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() {
return new BP_Registration_Compatibility;
}
/**
* Checks if we should init our settings and code.
*
* @since 4.2.8
* @since 4.4.0 Added BuddyBoss checking.
*
* @param object|string $bp BuddyPress instance, if available.
* @param object|string $bbp bbPress instance, if available.
*
* @return bool
*/
function bp_registration_should_init( $bp = '', $bbp = '' ) {
$should_init = ( is_object( $bp ) && version_compare( $bp->version, '2.5.0', '>=' ) ) ||
( is_object( $bbp ) && version_compare( $bbp->version, '2.0.0', '>=' ) );
if ( defined( 'BP_PLATFORM_VERSION' ) ) {
$should_init = version_compare( BP_PLATFORM_VERSION, '1.3.5', '>=' );
}
$should_init = (bool) apply_filters( 'bprwg_should_init', $should_init );
return $should_init;
}