Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Show comment
Hide comment
@geminorum
Owner

geminorum commented Dec 21, 2014

@BoweFrankema

This comment has been minimized.

Show comment
Hide comment
@BoweFrankema

BoweFrankema Jan 7, 2015

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

BoweFrankema commented Jan 7, 2015

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

@unsalkorkmaz

This comment has been minimized.

Show comment
Hide comment
@unsalkorkmaz

unsalkorkmaz commented Jan 7, 2015

@geminorum

This comment has been minimized.

Show comment
Hide comment
@geminorum

geminorum Jan 10, 2015

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.

Owner

geminorum commented Jan 10, 2015

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