Skip to:

Opened 11 years ago

Closed 11 years ago

#5246 closed enhancement (wontfix)

Add blog_id to activities

Reported by: wpdennis's profile wpdennis Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Activity Keywords:


In growing multisite networks it would be very nice to be able to show the latest activities on the specific blog e.g. as widget or to collect internal data about blog specific activities.

The component column isn't really the right place, since each blog could use multiple components on its own and it shouldn't be necessary to have unique components for each blog.

Could we add an indexed column "blog_id" to bp_activity? By default it just gets filled with get_current_blog_id()?

Change History (1)

#1 @boonebgorges
11 years ago

  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This is already possible. A query like this will get you blog-related activity from a specific site:

$args = array
    'component' => buddypress()->blogs->id,
    'item_id' => $blog_id,
if ( bp_has_activities( $args ) ) { // ...

In other words: for 'blogs' activity items, 'item_id' is set to the ID of the blog.

We do this instead of a dedicated blog_id activity column because the activity column is meant to be abstract and flexible. The majority BP activity items do *not* need a blog_id (just like the majority do not need group IDs), so we have generic item_id and secondary_item_id columns, which activity entries can use according to whatever column they'd like. Contrast this with user_id: nearly every activity entry has an associated user, so we have a dedicate column for it.

In the absence of evidence that blog_id is an overwhelmingly common requirement, I'm going to mark this as wontfix, because we already have the tools to do the necessary querying.

Note: See TracTickets for help on using tickets.