Skip to content

Blocks: Remove legacy Post Comment block conversions#69739

Closed
SainathPoojary wants to merge 1 commit into
WordPress:trunkfrom
SainathPoojary:remove-legacy-comment-blocks
Closed

Blocks: Remove legacy Post Comment block conversions#69739
SainathPoojary wants to merge 1 commit into
WordPress:trunkfrom
SainathPoojary:remove-legacy-comment-blocks

Conversation

@SainathPoojary

Copy link
Copy Markdown
Contributor

What?

Related to PR: #36171
Removes legacy conversion logic for core/post-comment-* blocks, as it was meant to be removed after WordPress 6.0.

Why?

  • The code included a TODO to remove these checks after WP 6.0.
  • WP is now at version 6.7.2, making this fallback logic redundant.

How?

Removed the condition for conversions:

  • core/post-comment-author → core/comment-author-name
  • core/post-comment-content → core/comment-content
  • core/post-comment-date → core/comment-date

Testing Instructions

npm run test:unit   

@github-actions

github-actions Bot commented Mar 28, 2025

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Blocks Overall functionality of blocks [Package] Blocks /packages/blocks labels Mar 28, 2025
@t-hamano

Copy link
Copy Markdown
Contributor

Thanks for the PR!

I'm not sure we should be able to remove these conversions.

Regardless of WordPress version, the legacy comment blocks may still be present in the content, so I don't think we can remove this fallback.

Steps to test this:

  • Insert the following HTML via the code editor in the site editor template:
    <!-- wp:post-comment {"commentId":1} -->
    <div class="wp-block-post-comment">
    <!-- wp:post-comment-author /-->
    <!-- wp:post-comment-content /-->
    <!-- wp:post-comment-date /-->
    </div>
    <!-- /wp:post-comment -->
  • Back to the visual editor

✅ trunk

Blocks are displayed correctly:

image

❌ This PR

Blocks are not displayed correctly:

image

cc @gziolo @cbravobernal

@Mamaduka

Mamaduka commented Apr 8, 2025

Copy link
Copy Markdown
Member

I agree with @t-hamano!

Considering that some of that conversion in the function has been around "forever", I don't think we should treat the Comments blocks any differently.

I'm going to close the PR. Thanks for contributing, @SainathPoojary!

@Mamaduka Mamaduka closed this Apr 8, 2025
@t-hamano

t-hamano commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Do we want to delete this comment instead? It may be confusing.

// TODO: Remove these checks when WordPress 6.0 is released.

@SainathPoojary

Copy link
Copy Markdown
Contributor Author

Hey @t-hamano, I agree. If we plan to keep this conversion, we should either remove the TODO or update it, as it might be confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Blocks Overall functionality of blocks [Package] Blocks /packages/blocks [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants