Skip to:
Content

Opened 5 years ago

Last modified 4 weeks ago

#4184 new enhancement

Exclude specific user_id’s when querying for activities

Reported by: username_ Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version:
Component: Activity Keywords: needs-patch
Cc:

Description

I didn’t see an exclude option for user_id just activity_id.

I do see the ability to include user_ids to be queried and that it can be an array of user_ids, most likely for the single member pages. But this is inclusive and I would like to see maybe the option to exclude some users from the main activity wall. Say user A doesn’t want to see user B’s updates anymore because they are negative… Some members seem to get on others nerves.

This option seems more important as a buddypress site grows in members say 5,000.

I'll try to look into some possible work around for now but all I can come up with are slow work around algorithms.

Change History (5)

#1 @DJPaul
5 years ago

  • Milestone changed from Awaiting Review to Future Release

#2 @slaFFik
4 weeks ago

  • Summary changed from exclude specific user_id’s in bp_has_activity() query to Exclude specific user_id’s when querying for activities

I see the value in this. Similar to post__in and post__not_in in WP_Query class.

What about the naming? user_id and user_id_not?

We basically need to create BP_Activity_Activity::get_not_in_operator_sql(). We already have BP_Activity_Query::get_sql_for_clause() which does support NOT IN.

See also bp_activity_get(), BP_Activity_Activity::get(), bp_has_activities().

#3 @boonebgorges
4 weeks ago

  • Keywords needs-patch added

user_id__in and user_id__not_in seem the most consistent.

We basically need to create BP_Activity_Activity::get_not_in_operator_sql(). We already have BP_Activity_Query::get_sql_for_clause() which does support NOT IN.

It may be better - less code, more future-compatible - to translate the new parameters into BP_Activity_Query objects.

#4 @slaFFik
4 weeks ago

  • Milestone changed from Future Release to 2.8

#5 @slaFFik
4 weeks ago

See #6645, that seems should be done before this ticket.

Also #6843 somewhat related in terms of BP_Activity_Query usage.

Last edited 4 weeks ago by slaFFik (previous) (diff)
Note: See TracTickets for help on using tickets.