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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
even if multiblog enabled, the
BP_ROOT_BLOG
is always point toget_current_blog_id()
so actually there's no need to check for that.