Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Activity Feed /RSS Filtering

  • @howsepa

    Participant

    I’m having some issues filtering out profile activity on our site.

    I need the RSS stream to only contain posts.
    I dont need any profile activity (such as avatar updates) or groups info, friends etc.

    i’ve tried several things from various posts ive found, including changing the code in the activity loop….

    if ( bp_has_activities( ‘action=new_blog_post’ ) ) :

    and adding a function in the functions.php.

    (
    function bp_remove_feeds() {

    remove_action( ‘wp’, ‘bp_activity_action_personal_feed’, 3 );
    remove_action( ‘wp’, ‘bp_activity_action_friends_feed’, 3 );
    remove_action( ‘wp’, ‘bp_activity_action_my_groups_feed’, 3 );
    remove_action( ‘wp’, ‘bp_activity_action_mentions_feed’, 3 );
    remove_action( ‘wp’, ‘bp_activity_action_favorites_feed’, 3 );

    }
    add_action(‘bp_include’, ‘bp_remove_feeds’);
    )

    The result appears to be that the info i require filtered out no longer appears on the web version of the stream (/activity) but it still seems to be being placed into the RSS feed (/activity/feed)

    Not sure were else to look now. Most of the information I have based these tweaks on appears to be quite old (4 years etc) We are running WP 4.0.1 – Salutation Theme – BP 2.03

    I need to do this as i’m using the RSS feed to create daily emails of posts out to employees, and only need to see posts, not profile updates etc.

    Any help gratefully received.
    TIA
    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant

    Give this a try – add to bp-custom.php or child-theme functions.php

    This will show only blog activities on site/user activity & rss page.

    function bpfr_filtering_activity( $retval ) {
    	$retval['object'] = 'blogs';		
    		return $retval;
    	}
    add_filter( 'bp_before_has_activities_parse_args', 'bpfr_filtering_activity' );

    Codex reference: https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/

    @howsepa

    Participant

    Thanks very much That appears to have done the trick.

    Checking the DB, the activity is still logged (an avatar change for example still ends up in the DB) however it does not appear on the activity log or in the RSS Feed. which is ideal!.

    Thanks again for that.
    Paul

    @danbp

    Participant

    You’re welcome. 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Activity Feed /RSS Filtering’ is closed to new replies.
Skip to toolbar