[buddypress-trac] [BuddyPress Trac] #6426: 'fields' => 'ids' for activity queries

buddypress-trac noreply at wordpress.org
Wed Aug 19 14:03:59 UTC 2015

#6426: 'fields' => 'ids' for activity queries
 Reporter:  boonebgorges          |       Owner:
     Type:  enhancement           |      Status:  new
 Priority:  normal                |   Milestone:  2.4
Component:  Component - Activity  |     Version:
 Severity:  normal                |  Resolution:
 Keywords:  has-patch             |

Comment (by boonebgorges):

 >  I'd be happy to stick with a plain activity IDs array in this case.

 Yeah. I keep trying to make us more consistent with WordPress, but it's
 hard. WP has `get_posts()`, which returns the `posts` array from a
 `WP_Query` object. We have a query class that returns a structured array
 (sorta like `WP_Query`), but our wrapper `bp_activity_get()` returns that
 entire multi-d array, instead of just the `activities` items. So either we
 follow WP here and return only the IDs, or we remain internally consistent
 and return `array( 'activities' => array( 1, 2, 3 ) ... )`. I guess I lean
 toward the latter, and maybe at some point in the future we can provide a
 convenience function that acts more like `get_posts()` in WP.

 > But, a dev would need to do the following to fetch all activity IDs

 This seems like expected behavior. `fields` is about the format of the
 return values. It shouldn't be a filter on the records returned.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6426#comment:10>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list