Skip to content

Commit

Permalink
Avoid PHP notices when fetching comment count for original items.
Browse files Browse the repository at this point in the history
Fixes #94.
  • Loading branch information
boonebgorges committed Mar 23, 2018
1 parent 83a98fa commit b3e37a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/class-project-organizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,9 @@ function display_item( $append_parent ) {
$original_comment_count = 0;
if ( ! empty( $anth_meta['original_post_id'] ) ) {
$original_post = get_post( $anth_meta['original_post_id'] );
$original_comment_count = $original_post->comment_count;
if ( $original_post ) {
$original_comment_count = (int) $original_post->comment_count;
}
}

// Then, see how many comments are being brought along to the export
Expand Down

0 comments on commit b3e37a8

Please sign in to comment.