• Hey Ron, fantastic plugin- just what the doctor ordered!

    I want to know how to force all BP pages to a secondary site/subdomain within each BP network?? like in:
    https://wpmututorials.com/news/new-features/multiple-buddypress-social-networks/#comment-12145

    I know I have to define the desired $site_id for each network_id in a mu-plugin,
    but unfortunately I’m no PHP programmer!

    So, what is missing here?

    <?php
    /* Set which site ID BuddyPress will run on in each network:  
    https://codex.buddypress.org/getting-started/customizing/changing-internal-configuration-settings/ 
    https://make.www.ads-software.com/core/tag/4-6+dev-notes/page/2/
    */
    
    function pl_bp_network_site_filter
          global $wpdb;
    	
        	if ( $wpdb->siteid = 1 || define ( 'BP_ROOT_BLOG', $site_id ) );
    	// Define this function for sharing BP throughout/across the sites of this network
    	//define ( ‘BP_ENABLE_MULTIBLOG’, true );
    	
    	if ( $wpdb->siteid = 2 || define ( 'BP_ROOT_BLOG', $site_id );
    	// Define this function for sharing BP throughout/across the sites of this network
    	//define ( ‘BP_ENABLE_MULTIBLOG’, true );
    	
    	if ( $wpdb->siteid = 3 || define ( 'BP_ROOT_BLOG', $site_id );
            // Define this function for sharing BP throughout/across the sites of this network
    	//define ( ‘BP_ENABLE_MULTIBLOG’, true );
    
    add_filter( 'bp_get_root_site_id', 'filter_root_site_id' ); // return site ID integer
    
    	}
    }
    
    /**
     * Call when the plugin is activated
     */
    register_activation_hook(__FILE__, 'define-BP-root');
    

    Thanks for your time!

    https://www.ads-software.com/plugins/bp-multi-network/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Works on secondary site in BP-multi-network?’ is closed to new replies.