Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Site Wide Activity Stream


  • tronix-ex
    Participant

    @tronix-ex

    Hi There,

    I am using the below code for filtering the Site Wide Activity which is working fine but it also applies on the members profile activity which is I don’t want. Please help.

    function bpfr_filtering_activity( $retval ) {
    	// activities to filter on, comma separated
    	$retval['action'] = 'new_forum_post, new_forum_topic';		
    		return $retval;
    	}	
    add_filter( 'bp_before_has_activities_parse_args', 'bpfr_filtering_activity' );

    Thanks,

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

  • danbp
    Participant

    @danbp

    Try this:

    function bpfr_filtering_activity( $retval ) {
    
    if ( bp_is_page( 'activity' ) ) {
    	// activities to filter on, comma separated
    	$retval['action'] = 'new_forum_post, new_forum_topic';
    }		
    		return $retval;
    	}	
    add_filter( 'bp_before_has_activities_parse_args', 'bpfr_filtering_activity' );

    tronix-ex
    Participant

    @tronix-ex

    Hi Danbp,

    You are simply awesome it worked, now all I need is to show 50 activities per page. I’ve used the below code but it still showing 20 activities.

    function bpfr_filtering_activity( $retval ) {
    if ( bp_is_page( 'activity' ) ) {
    	// activities to filter on, comma separated
    	$retval['action'] = 'new_forum_post, new_forum_topic';
    	$retval['max'] = '50';
    }		
    		return $retval;
    	}	
    add_filter( 'bp_before_has_activities_parse_args', 'bpfr_filtering_activity' );

    Thanks,


    danbp
    Participant

    @danbp

    try by adding $retval['per_page'] = 50;

    Codex reference

    Using bp_parse_args() to filter BuddyPress template loops


    tronix-ex
    Participant

    @tronix-ex

    That worked thank you so much, why am I getting repeated activity upon load more?


    tronix-ex
    Participant

    @tronix-ex

    Nevermind it works danbp you can close the topic. Ton of thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Site Wide Activity Stream’ is closed to new replies.
Skip to toolbar