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/bp-core-update.php

    r13490 r13533  
    861861        }
    862862
    863         /* Widgets **************************************************/
    864         $widget_options = array(
    865             'widget_bp_core_login_widget',
    866             'widget_bp_core_members_widget',
    867             'widget_bp_core_whos_online_widget',
    868             'widget_bp_core_recently_active_widget',
    869             'widget_bp_groups_widget',
    870             'widget_bp_messages_sitewide_notices_widget',
    871         );
    872 
    873         foreach ( $widget_options as $widget_option ) {
    874             bp_delete_option( $widget_option );
    875         }
    876 
    877863        // Finally make sure to rebuilt permalinks at next page load.
    878864        bp_delete_rewrite_rules();
    879865    }
     866
     867    // Widgets.
     868    $widget_options = array(
     869        'widget_bp_core_login_widget',
     870        'widget_bp_core_members_widget',
     871        'widget_bp_core_whos_online_widget',
     872        'widget_bp_core_recently_active_widget',
     873        'widget_bp_groups_widget',
     874        'widget_bp_messages_sitewide_notices_widget',
     875    );
     876
     877    foreach ( $widget_options as $widget_option ) {
     878        bp_delete_option( $widget_option );
     879    }
     880
     881    // Community visibility.
     882    bp_update_option( '_bp_community_visibility', array( 'global' => 'anyone' ) );
    880883}
    881884
Note: See TracChangeset for help on using the changeset viewer.