Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Hide Topics and Replies from choices


  • wafadul
    Participant

    @wafadul

    I already removed the bbpress topics and replies from my activity stream.

    Is there a way to hide the Topics and Replies from the “Show” drop down choices?

    Thanks!

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

  • danbp
    Moderator

    @danbp

    Since 2.1, the option dropdown is no more hardcoded in the template but is generated dynamically.

    I’m unable actually to tell you how to modify this new behave. (The old method is explained on the codex and in many topics here).

    On Codex, if you have a serious php level (it’s not exactly my case), it’s explained how to add a new option. I guess there is a way to do the inverse, but i read a lot and tried many things, but didn’t find any working solution.

    Meanwhile, i opened a topic on bbPress forum.

    I tried this after asking @imath but it doesn’t work (i use bbp 2.6 alpha on my test site)

    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' );
    

    In case of one of you have an idea: @shanebp, @henrywright, @r-a-y, @djpaul ?
    Merci beaucoup !


    wafadul
    Participant

    @wafadul

    thanks @danbp! appreciate the help, hope somebody can come up with the right code…


    danbp
    Moderator

    @danbp

    I finally asked Boone for help.

    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 );

    Works also by using bp_actions hook.


    wafadul
    Participant

    @wafadul

    wow! thanks so much @danbp – that did the trick!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Hide Topics and Replies from choices’ is closed to new replies.
Skip to toolbar