diff --git a/.github/changelog/fix-comment-count-ap-post-comments-admin-bar b/.github/changelog/fix-comment-count-ap-post-comments-admin-bar new file mode 100644 index 000000000..6ecf2b771 --- /dev/null +++ b/.github/changelog/fix-comment-count-ap-post-comments-admin-bar @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Admin bar: do not count interactions on posts from folks you follow in the comment bubble of the admin bar. diff --git a/includes/class-comment.php b/includes/class-comment.php index 47d7df3a8..38390a0a2 100644 --- a/includes/class-comment.php +++ b/includes/class-comment.php @@ -702,11 +702,12 @@ public static function comment_query( $query ) { return; } - // Do only exclude interactions of `ap_post` post type. - if ( \is_admin() ) { - $query->query_vars['post_type'] = array_diff( \get_post_types_by_support( 'comments' ), self::hide_for() ); - return; - } + /* + * Exclude interactions of `ap_post` post type from all comment queries + * (except ActivityPub and REST requests), so they are not shown in + * standard comment listings (including admin screens and frontend). + */ + $query->query_vars['post_type'] = array_diff( \get_post_types_by_support( 'comments' ), self::hide_for() ); // Do not exclude likes and reposts on non-singular pages. if ( ! \is_singular() ) {