When you are using BuddyPress with multisite and multiblog mode enabled, you will notice that member types for users are not synchronized across all blogs.
The problem arises due to ByddyPress multiblog mode. In this case, BuddyPress treats all blogs as the root installation of BuddyPress. Since the user to member type association is stored on the root blog, in this case, It is stored on the blog where the user’s member type update was made.
So the member type of user on blog 1 will not be visible on blog 2 and if you made some change on blog 1, It will only be visible there.
Using Global Association:-
To alleviate it and use the global association, we can instruct BuddyPress to use the association from one of the blogs as the source of truth and all changes should be stored there.
Here is the code that you can put in your bp-custom.php to do that.
1 2 3 4 5 6 7 8 9 10 | /** * Fix the synchronization of the member types across all blogs on multisite, multiblog mode. */ function buddydev_fix_multiblog_taxonomy_site_id( $blog_id ) { $blog_id = BLOG_ID_CURRENT_SITE; // Change it. // Put the blog id you want all the member type associations with user to be saved // If you have existing association, you may want to use that return $blog_id; } add_filter( 'bp_get_taxonomy_term_site_id', 'buddydev_fix_multiblog_taxonomy_site_id' ); |
Here I have used the main blog id of the network as the source for storing/retrieving the user to member type associations.
You can use a different blog id if you have existing user with member types associated on that blog. I will recommend sticking to the main site though.