Skip to:
Content

BuddyPress.org

Changeset 8929


Ignore:
Timestamp:
08/16/2014 12:23:04 PM (11 years ago)
Author:
imath
Message:

Make sure the updated activity after a post update is consistent with the initial activity.

In Blogs component, when recording a new_blog_post" update, bp_activity_thumbnail_content_images() and bp_create_excerpt() are used to build the content of the activity. After a updating the post from the dashboard, bp_blogs_update_post() was simply updating the activity with the entire post content.

bp_blogs_update_post() is now using the same functions than bp_blogs_record_activity() to update the content of the activity.

Fixes #5792

File:
1 edited

Legend:

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

    r8763 r8929  
    572572    // update the activity entry
    573573    $activity = new BP_Activity_Activity( $activity_id );
    574     $activity->content = $post->post_content;
     574
     575    if ( ! empty( $post->post_content ) ) {
     576        // Make sure to update the thumbnail image
     577        $post_content = bp_activity_thumbnail_content_images( $post->post_content, $activity->primary_link, (array) $activity );
     578
     579        // Make sure to apply the blop post excerpt
     580        $activity->content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $post_content ), $post_content, (array) $activity );
     581    }
     582
     583    // Save the updated activity
    575584    $activity->save();
    576585
Note: See TracChangeset for help on using the changeset viewer.