Opened 9 years ago
Last modified 4 years ago
#4184 new enhancement
Exclude specific user_id’s when querying for activities
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | needs-patch good-first-bug needs-unit-tests |
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 (7)
#2
@
4 years ago
- Summary changed from exclude specific user_id’s in bp_has_activity() query to Exclude specific user_id’s when querying for activities
#3
@
4 years 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.
I see the value in this. Similar to
post__in
andpost__not_in
inWP_Query
class.What about the naming?
user_id
anduser_id_not
?We basically need to create
BP_Activity_Activity::get_not_in_operator_sql()
. We already haveBP_Activity_Query::get_sql_for_clause()
which does supportNOT IN
.See also
bp_activity_get()
,BP_Activity_Activity::get()
,bp_has_activities()
.