Skip to content

Commit

Permalink
Don't create group activity for draft papers.
Browse files Browse the repository at this point in the history
  • Loading branch information
boonebgorges committed Jan 7, 2016
1 parent 61d3295 commit 515a923
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/hooks-buddypress-group.php
Expand Up @@ -243,6 +243,12 @@ function cacsp_create_added_to_group_activity( CACSP_Paper $paper, $group_id ) {
return;
}

// Only published paper should have activity created.
$post_status = $paper->post_status;
if ( 'publish' !== $post_status ) {
return;
}

// The author of the edit is the one who wrote the last revision.
if ( $revisions = wp_get_post_revisions( $paper->ID ) ) {
// Grab the last revision, but not an autosave.
Expand Down

0 comments on commit 515a923

Please sign in to comment.