[buddypress-trac] [BuddyPress Trac] #8348: Enhance the bp_activity table design by adding site_id

buddypress-trac noreply at wordpress.org
Mon Mar 22 22:12:06 UTC 2021


#8348: Enhance the bp_activity table design by adding site_id
-----------------------------+------------------------------
 Reporter:  shawfactor       |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Activity         |     Version:  6.2.0
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by r-a-y):

 Yes, this is definitely an issue on multisite.

 On a BP install, we're working around this by saving the site ID as
 activity meta:


 {{{
 #!php
 add_action( 'bp_activity_after_save', function( $activity ) {
         if ( ! bp_is_root_blog() ) {
                 bp_activity_update_meta( $activity->id, 'site_id',
 get_current_blog_id() );
         }
 } );
 }}}

 And then referencing the site ID whenever something needs to be done.

 For example, whenever a site's visibility (`blog_public`) is changed to
 something less than 1, we update all activity for the site to
 `hide_sitewide = 1`. This is probably something BP should do in core. Also
 related is #4791, which talks about doing the same thing, but for group
 status changes.

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


More information about the buddypress-trac mailing list