2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-03 08:59:21 +08:00

Don't require existing wp comments to show wp comments with setting (#523)

This commit is contained in:
Angus McLeod 2024-06-27 20:13:28 +02:00 committed by GitHub
parent 6b2ba54c8e
commit 0a3eb4fa28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,10 +318,7 @@ class DiscourseComment extends DiscourseBase {
break;
}

// Use $post->comment_count because get_comments_number will return the Discourse comments
// number for posts that are published to Discourse.
$num_wp_comments = $post->comment_count;
if ( empty( $this->options['show-existing-comments'] ) || 0 === intval( $num_wp_comments ) ) {
if ( empty( $this->options['show-existing-comments'] ) ) {
echo wp_kses_post( $discourse_comments );

return WPDISCOURSE_PATH . 'templates/blank.php';