Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Removing Widgets Altogether


  • johnosmond
    Participant

    @johnosmond

    Hi. How can I remove the buddypress widget controls altogether? (ie, I don’t just not want their content on the web site, I don’t want the buddypress widgets in the widget dashboard area at all.)

    My system:
    wp 4.o multi-site, installed in root directory
    using a child theme of twenty twelve
    buddypress 2.0.2, no bbpress.

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)

  • johnosmond
    Participant

    @johnosmond

    Partial solution (incomplete):

    I created the bp-custom.php file but since I’m using multisite it must go in the mu-plugins folder, NOT the regular plugins folder.

    In that file I placed (found from searches):

    add_action( 'plugins_loaded', 'my_bp_mu_widgets_init' );
    function my_bp_mu_widgets_init() {
    	if( !is_main_site() ) {
    		remove_all_actions('bp_register_widgets');
    	}
    }

    That got rid of all but three widgets (Friends, Groups, and Site Wide Notices)

    Anyone know how to get rid of those?


    johnosmond
    Participant

    @johnosmond

    Ok, I resolved the rest of it. I created a plugin and added this (it wouldn’t work until I raised the priority level to 20):
    add_action( ‘widgets_init’, ‘my_plugin_widgets_init’, 20 );

    function my_plugin_widgets_init() {
    	if( !is_main_site() ) {
    		unregister_widget('BP_Core_Friends_Widget');
    		unregister_widget('BP_Groups_Widget');
    		unregister_widget('BP_Messages_Sitewide_Notices_Widget');
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Removing Widgets Altogether’ is closed to new replies.
Skip to toolbar