Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/28/2023 04:15:24 PM (3 years ago)
Author:
dcavins
Message:

Introduce basic community visibility feature.

Site admins now have the option to restrict access to the
community portion of a BuddyPress site. If the site admin
chooses "members only," then, when a non-logged-in
user attempts to visit a BuddyPress screen, she will
be shown an access error message and a log-in form.

Props imath, sbrajesh, jjj, shawfactor.

Fixes #8734.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-admin.php

    r13468 r13533  
    476476        add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
    477477        register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
     478
     479        // Community Visibility
     480        if ( 'rewrites' === bp_core_get_query_parser() ) {
     481            add_settings_field( '_bp_community_visibility', __( 'Community Visibility', 'buddypress' ), 'bp_admin_setting_callback_community_visibility', 'buddypress', 'bp_main' );
     482            register_setting( 'buddypress', '_bp_community_visibility', 'bp_admin_sanitize_callback_community_visibility' );
     483        }
    478484
    479485        // Template pack picker.
Note: See TracChangeset for help on using the changeset viewer.