Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to remove option from buddypress activity dropdown


  • danbp
    Participant

    @danbp

    WP 4.5.3 – BP 2.6 – bbP 2.6 alpha -2016

    I want to remove the 2 bbp related options (topics & replies) from BP’s site wide activity filter dropdown.

    I’m using this function, but it has no effect:

    function remove_activity_filters( $bbp_buddypress = null ) {
       if ( bp_is_active( 'activity' ) && bp_is_activity_component() ) {
          // Remove forum filters in site wide activity streams
          remove_action( 'bp_activity_filter_options', array( bbpress()->extend->buddypress->activity, 'activity_filter_options' ), 10 );
       }
    add_action( 'bbp_buddypress_loaded', 'remove_activity_filters' );
Viewing 2 replies - 1 through 2 (of 2 total)

  • danbp
    Participant

    @danbp

    Answering to myself:

    bbp_buddypress_loaded fires before everything is, in fact, fully loaded. bbPress’s component-specific extensions aren’t loaded until bp_init:7 (ty @boonebgorges for this explanation).

    Changing add_action to bp_init with a priority of 8 did the job !

    This may work for Site Activities, Members and Group activities

    function bpfr_remove_activity_dropdown_label() {
       // Remove forum filters in site wide activity streams
       remove_action( 'bp_activity_filter_options',        array( bbpress()->extend->buddypress->activity , 'activity_filter_options'   ), 10    );
    
       // Remove forum filters in single member activity streams
       remove_action( 'bp_member_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options'   ), 10   ); 
    
       // Remove forum filters in single group activity streams
       remove_action( 'bp_group_activity_filter_options',  array( bbpress()->extend->buddypress->activity , 'activity_filter_options'   ), 10   );
    }
    add_action( 'bp_init', 'bpfr_remove_activity_dropdown_label', 8 );

    wafadul
    Participant

    @wafadul

    hi @danbp!

    how can i remove “New Members”?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar