Skip to content

Commit c46cd0a

Browse files
committed
Speeds up the loading of posts with lots of comments
1 parent 607cf28 commit c46cd0a

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

includes/class-comment-walker.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,22 +288,14 @@ public static function comment_query( $query ) {
288288
return;
289289
}
290290

291-
if ( is_admin() ) {
291+
if ( is_admin() || ! is_singular() ) {
292292
return;
293293
}
294294

295-
if ( ! is_singular() ) {
295+
if ( ! empty( $query->query_vars['type__in'] ) ) {
296296
return;
297297
}
298298

299-
if ( ! empty( $query->query_vars['meta_query'] ) ) {
300-
$query_vars = current( $query->query_vars['meta_query'] );
301-
302-
if ( ! empty( $query_vars['key'] ) && 'protocol' === $query_vars['key'] ) {
303-
return;
304-
}
305-
}
306-
307299
if ( isset( $query->query_vars['count'] ) && true === $query->query_vars['count'] ) {
308300
return;
309301
}

templates/webmention-comments.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
array(
44
'post_id' => get_the_ID(),
55
'type__in' => get_webmention_comment_type_names(),
6-
'meta_query' => array(
7-
array(
8-
'key' => 'protocol',
9-
'compare' => 'EXISTS',
10-
),
11-
),
126
'status' => 'approve',
137
)
148
);

0 commit comments

Comments
 (0)