[buddypress-trac] [BuddyPress Trac] #8734: Introduce simple "Private Site" toggle

buddypress-trac noreply at wordpress.org
Thu Jul 27 16:12:38 UTC 2023


#8734: Introduce simple "Private Site" toggle
------------------------------+-----------------------
 Reporter:  dcavins           |       Owner:  (none)
     Type:  feature request   |      Status:  assigned
 Priority:  normal            |   Milestone:  12.0.0
Component:  Core              |     Version:  10.4.0
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-----------------------

Comment (by dcavins):

 @shawfactor: Here's one way to prevent the new settings field from being
 built:

 {{{
 add_action( 'bp_register_admin_settings',
 'remover_bp_community_visibility_admin_settings', 14 );
 function remover_bp_community_visibility_admin_settings() {
         global $wp_settings_fields;

         unregister_setting( 'buddypress', '_bp_community_visibility' );
         if ( isset( $wp_settings_fields[ 'buddypress' ][ 'bp_main' ][
 '_bp_community_visibility' ] ) ) {
                 unset( $wp_settings_fields[ 'buddypress' ][ 'bp_main' ][
 '_bp_community_visibility' ] );
         }
 }
 }}}

 It's simple enough that I don't think we need to add another
 `apply_filters()` in BP's `register_admin_settings()` setup.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8734#comment:49>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list