Skip to:
Content

Changeset 5562


Ignore:
Timestamp:
12/16/11 20:49:40 (2 years ago)
Author:
boonebgorges
Message:

Don't rerecord an activity item for a blog post being edited, to prevent bumping up the stream. Fixes #3746

File:
1 edited

Legend:

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

    r5355 r5562  
    181181    if ( 'publish' == $post->post_status && empty( $post->post_password ) ) { 
    182182        if ( $is_blog_public || !is_multisite() ) { 
     183             
    183184            // Record this in activity streams 
    184185            $post_permalink   = get_permalink( $post_id ); 
     
    188189            else 
    189190                $activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 
     191 
     192            // Make sure there's not an existing entry for this post (prevent bumping) 
     193            $existing = bp_activity_get( array( 
     194                'filter' => array( 
     195                    'user_id'      => (int)$post->post_author, 
     196                    'action'       => 'new_blog_post', 
     197                    'primary_id'   => $blog_id, 
     198                    'secondary_id' => $post_id, 
     199                ) 
     200            ) ); 
     201             
     202            if ( !empty( $existing['activities'] ) ) { 
     203                return; 
     204            } 
    190205 
    191206            $activity_content = $post->post_content; 
Note: See TracChangeset for help on using the changeset viewer.