Skip to:
Content

BuddyPress.org

Ticket #5792: 5792.patch

File 5792.patch, 914 bytes (added by imath, 11 years ago)
  • src/bp-blogs/bp-blogs-functions.php

    diff --git src/bp-blogs/bp-blogs-functions.php src/bp-blogs/bp-blogs-functions.php
    index 3b59417..67685b1 100644
    function bp_blogs_update_post( $post ) { 
    571571
    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
    577586        // add post comment status to activity meta if closed