Skip to content

Instantly share code, notes, and snippets.

@geminorum
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geminorum/4285746f0d67c141b878 to your computer and use it in GitHub Desktop.
Save geminorum/4285746f0d67c141b878 to your computer and use it in GitHub Desktop.
Hide BuddyPress widgets on Multisite install, Better way!
<?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
@geminorum
Copy link
Author

@BoweFrankema
Copy link

Thank you! Updated the snippet on BP-Tricks.com :-)

@unsalkorkmaz
Copy link

@geminorum
Copy link
Author

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