-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post Comments block: Merge Comments Query Loop block #40521
Comments
Living TODO list:
|
@peterwilsoncc We'd actually like to include it in 6.0 😊 We're hoping to get the PR ready for inclusion in Beta 3 (or RC1, at latest) so there'll be still a couple of weeks to test and polish them. The major driver here is avoiding polluting the block namespace, as per Matías' list that I quoted in the issue desc, which will in turn help avoiding confusion to users about too many competing Comments related blocks (plus needing to deprecate and migrate them later). The change itself should be fairly self-contained: We're basically adding logic to the Post Comments' |
WordPress has been in feature freeze since Beta 1 and I think this is a major enhancement that should not be put in. I can't see it been close to ready in time for the final beta on Tuesday. I noticed on Friday the new comments block is missing a few features that would prevent 1:1 transformation, for example the pre-moderation preview is not shown to new commenters. See #40601 |
Fair enough 😅 I was probably a bit over-optimistic, but since #40522 has hit a few bumps, we'll punt that and won't try to get it into 6.0.
Thanks for flagging, we'll look into this! |
I'm fine with punting since this is running into some issues, but I'm still fairly concerned about the namespace issue — offering multiple blocks that do the same with no strategy for consolidating is not very reasonable. What are the options to minimize the impact there? |
I think hiding one or the other from the inserter makes sense, I'll leave it to y'all to decide which. I suggest:
This avoids migrating too early and alienating some of the biggest external advocates for block themes. Once there is feature parity the migration can occur. I think the approach Dave detailed in #33440 would need to be used. Neither approach it optimal but I think this is the least sub-optimal as it avoids rushing a migration after feature freeze and removing features in the process. |
Thanks @peterwilsoncc, that sounds like a good strategy!
Yeah, one of the registration-level block filters should do the trick. We'll write up a note! |
I assume the function enable_post_comments_legacy_block( $metadata ) {
if ( 'core/post-comments' === $metadata['name'] ) {
$metadata['title'] = 'Post Comments';
$metadata['supports']['inserter'] = true;
}
return $metadata;
}
add_filter( 'block_type_metadata', 'enable_post_comments_legacy_block' ); What do you think? Does it make sense? |
@SantosGuillamot kindly posted the dev note here: #39654 (comment) |
Fixed by #41807 🎉 |
As per discussion with @mtias here and via DM, we should merge the Comments Query Loop block into the existing Post Comments block, with the following behavior:
comment_form()
. In the editor, we’ll display the placeholder.If it’s newly inserted: insert child blocks as specified in its default template (as Comments Query Loop does already).
This means that the block will provide backward-compat for Post Comments (where it’s been used for existing themes); OTOH, it will provide the new functionality by default when newly inserted.
Quoting Matías:
Note that there will be some edge cases that can lead to slightly awkward user experience, e.g. trying to edit a previously inserted empty Post Comments block (will show a placeholder in the editor). Matías said not to worry about these for 6.0.
cc/ @WordPress/frontend-dx @priethor @gziolo
The text was updated successfully, but these errors were encountered: