Last active
August 29, 2015 14:11
-
-
Save geminorum/4285746f0d67c141b878 to your computer and use it in GitHub Desktop.
Hide BuddyPress widgets on Multisite install, Better way!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bp_include_remove_widgets() { | |
if ( ! bp_is_root_blog() ) | |
remove_all_actions( 'bp_register_widgets' ); | |
} add_action( 'bp_include', 'bp_include_remove_widgets', 5 ); // priority is crucial |
Thank you! Updated the snippet on BP-Tricks.com :-)
I believe this one is much better way:
http://theme.firmasite.com/hide-buddypress-widgets-multisite-install/
even if multiblog enabled, the BP_ROOT_BLOG
is always point to get_current_blog_id()
so actually there's no need to check for that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see the bp tricks snippet.