Skip to content

feat : backport populate_post_content_inner_blocks #34

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

Closed

Conversation

Ta5r
Copy link
Collaborator

@Ta5r Ta5r commented Dec 17, 2024

What you did in this PR ?

Back ported functionality to populate innerBlocks of the core/post-content block with the parsed blocks.

Why is it necessary ?

To ensure core/post-content block dynamically includes blocks from the post content.

How ?

  • Back ported populate_post_content_inner_blocks to fetch the post's content, parse it into blocks, and assign it to the innerBlocks property if available.

Tasks :

  • Backport populate_post_content_inner_blocks.
  • Add Codeception unit test.

@Ta5r Ta5r self-assigned this Dec 17, 2024
@Ta5r Ta5r requested a review from justlevine December 18, 2024 11:07
Co-authored-by: Ta5r <srv.tanay@gmail.com>
@justlevine justlevine force-pushed the feat/backporting_populate_post_content_inner_blocks branch 2 times, most recently from 8e2e921 to 0980c00 Compare December 18, 2024 22:38
@justlevine justlevine marked this pull request as ready for review December 18, 2024 22:40
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking: wpengine#326

@Ta5r the issue with your test was infinite recursion: you were using a PostContent block inside the WP_Post.post_content, so it kept trying to replace itself.

Take a look at the diff to see how I used the Term as an intermediary.

justlevine and others added 2 commits December 19, 2024 17:28
Co-authored-by: Ta5r <srv.tanay@gmail.com>
@justlevine justlevine force-pushed the feat/backporting_populate_post_content_inner_blocks branch from 0980c00 to 5381c84 Compare December 19, 2024 23:21
@justlevine
Copy link
Collaborator

wpengine#326

@justlevine justlevine closed this Jan 27, 2025
@justlevine justlevine deleted the feat/backporting_populate_post_content_inner_blocks branch January 27, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants