Opened 9 years ago
Closed 9 years ago
#6850 closed enhancement (fixed)
Filter for activity sql JOIN query
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | |
Cc: |
Description
Similar to #2674, can you please add filter for activity sql JOIN query?
bp-activity/classes/class-bp-activity-activity.php line 460
BP_Activity_Activity::get()
Existing WHERE condition filter
$where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql );
$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
Sometimes cannot be used without JOIN filter.
Is there possibility to add something like?:
apply_filters( 'bp_activity_get_join', array( $join_sql ), $r, $select_sql, $from_sql );
Thank you.
===
I'm trying to exclude some activities based on data in other tables
without affecting pagination, counting and other stuff.
Change History (3)
#2
@
9 years ago
- Milestone changed from Under Consideration to 2.5
- Owner set to boonebgorges
- Status changed from new to assigned
I hate introducing filters on SQL queries, but @jozik is correct that the existing WHERE filter is not completely usable without a corresponding filter on JOIN. (You could filter the concatenated query to make this work, but you'd need some fancy regex.) Let's just do it.
@boone I think it was Activity you did a lot of work on a year ago or so -- does this suggestion make sense?