diff --git src/bp-core/admin/bp-core-admin-functions.php src/bp-core/admin/bp-core-admin-functions.php
index 2a88837d5..ff5125048 100644
|
|
function bp_core_activation_notice() { |
284 | 284 | |
285 | 285 | // Activate and Register are special cases. They are not components but they need WP pages. |
286 | 286 | // If user registration is disabled, we can skip this step. |
287 | | if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) { |
| 287 | if ( bp_allow_access_to_registration_pages() ) { |
288 | 288 | $wp_page_components[] = array( |
289 | 289 | 'id' => 'activate', |
290 | 290 | 'name' => __( 'Activate', 'buddypress' ), |
diff --git src/bp-core/admin/bp-core-admin-slugs.php src/bp-core/admin/bp-core-admin-slugs.php
index 4701f8f46..d116eef9b 100644
|
|
function bp_core_admin_slugs_options() { |
187 | 187 | |
188 | 188 | <h3><?php esc_html_e( 'Registration', 'buddypress' ); ?></h3> |
189 | 189 | |
190 | | <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : ?> |
| 190 | <?php if ( bp_allow_access_to_registration_pages() ) : ?> |
191 | 191 | <p> |
192 | 192 | <?php esc_html_e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?> |
193 | 193 | <?php esc_html_e( 'These pages will only be reachable by users who are not logged in.', 'buddypress' ); ?> |
… |
… |
function bp_core_admin_slugs_options() { |
227 | 227 | <table class="form-table"> |
228 | 228 | <tbody> |
229 | 229 | |
230 | | <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : foreach ( $static_pages as $name => $label ) : ?> |
| 230 | <?php if ( bp_allow_access_to_registration_pages() ) : foreach ( $static_pages as $name => $label ) : ?> |
231 | 231 | |
232 | 232 | <tr valign="top"> |
233 | 233 | <th scope="row"> |
diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index e2acd9373..3dbc32f11 100644
|
|
function bp_core_add_page_mappings( $components, $existing = 'keep' ) { |
702 | 702 | |
703 | 703 | // Register and Activate are not components, but need pages when |
704 | 704 | // registration is enabled. |
705 | | if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) { |
| 705 | if ( bp_allow_access_to_registration_pages() ) { |
706 | 706 | foreach ( array( 'register', 'activate' ) as $slug ) { |
707 | 707 | if ( ! isset( $pages[ $slug ] ) ) { |
708 | 708 | $pages_to_create[ $slug ] = $page_titles[ $slug ]; |
diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
index 2953aad11..39cfd6e65 100644
|
|
function bp_get_members_invitations_allowed() { |
2925 | 2925 | return apply_filters( 'bp_get_members_invitations_allowed', bp_is_active( 'members', 'invitations' ) && (bool) bp_get_option( 'bp-enable-members-invitations' ) ); |
2926 | 2926 | } |
2927 | 2927 | |
| 2928 | /** |
| 2929 | * Should the system create and allow access |
| 2930 | * to the Register and Activate pages? |
| 2931 | * |
| 2932 | * @since 10.0.0 |
| 2933 | * |
| 2934 | * @return bool |
| 2935 | */ |
| 2936 | function bp_allow_access_to_registration_pages() { |
| 2937 | $retval = bp_get_signup_allowed() || bp_get_members_invitations_allowed(); |
| 2938 | |
| 2939 | /** |
| 2940 | * Filters whether or not the system should create and allow access |
| 2941 | * to the Register and Activate pages. |
| 2942 | * |
| 2943 | * @since 10.0.0 |
| 2944 | * |
| 2945 | * @param bool $retval Whether or not to allow access to |
| 2946 | * the Register and Activate pages. |
| 2947 | */ |
| 2948 | return apply_filters( 'bp_allow_access_to_registration_pages', $retval ); |
| 2949 | } |
| 2950 | |
2928 | 2951 | /** |
2929 | 2952 | * Hook member activity feed to <head>. |
2930 | 2953 | * |