WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Webmentions are not handled properly by the comment blocks #58366

Open carolinan opened 9 months ago

carolinan commented 9 months ago

Description

This was originally reported on core trac: https://core.trac.wordpress.org/ticket/59739 and the support forum https://wordpress.org/support/topic/separate-webmention-types-from-comments/

Because it concerns feature parity between the comments block and the classic comment type filters, I am moving it here.

With the new comments template for Twenty Twenty-Three, webmentions are not properly filtered: they appear both as comment and like or repost… Expected result: if a comment is a like/repost webmention, the comment is hidden, but the like/repost webmention is shown accordingly. I use the Webmention plugin by Pfefferle (+ IndieWeb and Syndication Links plugins). This means one of these plugins might probably have to handle all or part of the styling/behavior.

Step-by-step reproduction instructions

Reproduction steps were not provided by the reported, testing is needed.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

cybeardjm commented 9 months ago

How to reproduce:

The "Bridgy Response" comment should be filtered out and hidden by the comments block, allowing only the proper likes and reposts to be shown.

PS: had to use another extension (Indieblocks by @janboddez ) to make the problem "disappear" for now.

janboddez commented 9 months ago

I'm fairly sure this is an "issue" with the Webmention plugin: it filters out, I believe, the "like/repost/etc." comments and shows them separately. Except somehow it fails at removing them from the "actual comments" list.

I believe it works OK with classic themes, however.

The IndieBlocks plugin uses a block render callback to filter the output of the comments block and aims to be compatible, at least in this regard, with the Webmention plugin. _Edit: Just had another look and it looks like IndieBlocks really only filters comments using the pre_get_comments hook. It also filters the comment count (in order to count only the "real" comments)._

In short, the Webmention plugin, on its own, may not be 100% compatible with block themes. Looks like it may be missing a pre_get_comments, or similar, callback. (I seem to remember it does its "filtering" using a custom comment walker or so, which I think may be ignored by the comments block?)

Doubt this is a Gutenberg issue, though, since it can be made to work.