WordPress.org

Forums

BadgeOS Community Add-on
[resolved] Filtering activity badge in buddypress stream (2 posts)

  1. halleg
    Member
    Posted 1 year ago #

    Dear BadgeOs team,

    Really liked the plugin and I am a premium add-on user. Just wanted to know if you had a snippet to use for buddypress, to filter the activity stream.

    I have a badge for loyalty visit (1 point each time you come back and login), but then the activity stream is only showing these and get spammy.

    I have quests that are important to be seen by others, but these type of low level badge must not be streamed as they are today.

    Can you help? My blog is treatmybrand,com

    https://wordpress.org/plugins/badgeos-community-add-on/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 1 year ago #

    Not sure there is much we have specifically for this case. What we have going on is we attach a callback to the badgeos_award_achievement action and when that fires, we do a bp_activity_add() call with our information. We're not doing any sort of thing that'd allow for filtering of the activity feed itself

    I know BuddyPress has this hook at the end of bp_activity_add(), but it's something that fires after the insertion of the activity.

    do_action( 'bp_activity_add', $params );

    Perhaps you could hook into that and delete some of the activity posts conditionally?

    There is also bp_activity_get() with a filter of

    return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );

    that you could potentially filter out some of the results as needed.

    Both functions can be found in /buddypress/bp-activity/bp-activity-functions.php with bp_activity_add starting at line 1105 and bp_activity_get starting at line 942

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BadgeOS Community Add-on
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic