Skip to:
Content

BuddyPress.org

#8744 closed defect (bug) (fixed)

"Comments" title is displayed in BuddyPress pages when the core/comments block is used

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 10.5.0 Priority: high
Severity: normal Version: 10.4.0
Component: Core Keywords: has-patch
Cc:

Description

Unlike Twenty Twenty-Two, Twenty Twenty-Three is using the core/comments block to display the wp:comment-template block template.

core/comments's render function is performing a comment count even if comments are closed requiring us to also filter the comments query to make sure this count is 0 on BuddyPress pages (and when the post_id is 0).

On a side note, it's kind of weird WordPress comments count is 1 when the post_id is 0 🤔.

Attachments (1)

8744.patch (1.9 KB) - added by imath 20 months ago.

Download all attachments as: .zip

Change History (3)

@imath
20 months ago

#1 @imath
20 months ago

In 13332:

Avoid querying for comments when viewing a BuddyPress page in TT3

The Twenty Twenty-Three block theme is using the core/comments block to
display comments for WP Pages or Posts. After checking if comments are
open, this block is doing an additional comment count query which wrongly
returns the site's all comment count as BuddyPress pages ID is reset to
0.

In this case forcing comments to be closed is not enough, we also need to
force the comment count to be 0.

See #8744 (trunk)

--Cette ligne, et les suivantes
ci-dessous, seront ignorées--

M src/bp-core/bp-core-filters.php
M src/bp-core/bp-core-theme-compatibility.php

#2 @imath
20 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13333:

Avoid querying for comments when viewing a BuddyPress page in TT3

The Twenty Twenty-Three block theme is using the core/comments block to
display comments for WP Pages or Posts. After checking if comments are
open, this block is doing an additional comment count query which wrongly
returns the site's all comment count as BuddyPress pages ID is reset to
0.

In this case forcing comments to be closed is not enough, we also need to
force the comment count to be 0.

Fixes #8744 (branch 10.0)

Note: See TracTickets for help on using tickets.