Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/01/2021 05:43:00 PM (3 years ago)
Author:
imath
Message:

Activity: make sure Activity author is synced with Post Type author

When the author of a Post has been updated, the corresponding user_id into the related Post Type Activity needs to be updated as well.

Props rigsbyx

Fixes #8579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r13128 r13135  
    23122312    $activity = new BP_Activity_Activity( $activity_id );
    23132313
     2314    // Check if the Post author has changed.
     2315    if ( (int) $post->post_author !== (int) $activity->user_id ) {
     2316        $activity->user_id = (int) $post->post_author;
     2317    }
     2318
    23142319    if ( ! empty( $post->post_content ) ) {
    23152320        $activity_summary = bp_activity_create_summary( $post->post_content, (array) $activity );
Note: See TracChangeset for help on using the changeset viewer.