[buddypress-trac] [BuddyPress Trac] #4988: bp_has_activities to accept multi scope

buddypress-trac noreply at wordpress.org
Thu Dec 4 20:21:07 UTC 2014


#4988: bp_has_activities to accept multi scope
-------------------------+------------------
 Reporter:  henrywright  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.2
Component:  Activity     |     Version:  1.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by boonebgorges):

 Thanks for your work on this, r-a-y! I think it's headed in a great
 direction. Some thoughts as I read over the patch:

 - I committed the `extract()` stuff in [9213] just to get it out of the
 way
 - The override technique here looks fine. If we think of 'scope' as a
 shorthand way of signifying certain groups of arguments, then it makes
 sense that we'd force arguments in these cases.
 - We should probably accept an array as well as comma-separated values for
 'scope'.
 - Regarding the 'hide_sitewide' override. Doing this at the level of the
 SQL clause construction seems precarious to me, especially when checking
 `bp_loggedin_user_id()`. This makes it hard to, say, do certain kinds of
 queries programatically. Is it possible to move that logic up a level,
 like maybe into `bp_has_activities()` or something like that? Also worth
 noting: hide_sitewide should be true when inside of a group for members of
 that group (or private group activity will never appear).
 - `EXISTS` and `NOT EXISTS` don't seem that important to me. Let's leave
 them out, and we can look at adding them in the future if people need
 them.
 - Regarding 'type', we only really need to support this if we're going to
 allow for numerical comparisons. Like, I guess, "show me the activities
 associated with users whose IDs are between 10 and 15". Pretty unlikely.
 (Date comparisons are excluded from what you're doing here, and are
 covered by date_query.)
 - Very small point: let's not trim 'value'. I think `WP_Meta_Query` etc do
 this only for legacy reasons, but IMO it makes no sense. People should be
 able to store and compare whatever values they want.

 [attachment:4988.03.patch] is the same as 02.patch, minus the `extract()`
 stuff.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4988#comment:18>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list