Skip to content

Editor: Parse blocks in Latest Posts full content#12421

Closed
getdave wants to merge 2 commits into
WordPress:trunkfrom
getdave:backport-gutenberg-pr-74866
Closed

Editor: Parse blocks in Latest Posts full content#12421
getdave wants to merge 2 commits into
WordPress:trunkfrom
getdave:backport-gutenberg-pr-74866

Conversation

@getdave

@getdave getdave commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This PR now only adds PHPUnit coverage for the block content filtering helper used by the Latest Posts full-content rendering fix.

The implementation changes have already landed separately:

The remaining diff in this PR is tests/phpunit/tests/blocks/wpApplyBlockContentFilters.php. The tests cover applying the expected content filters, rendering block markup returned by shortcodes, passing the image filter context through, processing embeds, and clearing recursion-guard state after successful and exceptional block rendering.

Trac ticket: https://core.trac.wordpress.org/ticket/65586

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT / Codex
Model(s): GPT-5
Used for: Unit test scaffolding, command execution, and PR description drafting. Final tests and PR description were reviewed by me.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@getdave @scruffian @MaggieCabrera, Is it possible to move this PR forward to meet the Beta 1 deadline? At a minimum, the changes in the following two files need to be reverted, as they are automatically synchronized from Gutenberg.

  • src/wp-includes/blocks/latest-posts.php
  • src/wp-includes/blocks/template-part.php

@t-hamano

Copy link
Copy Markdown
Contributor

I have updated this PR according to WordPress/gutenberg#80191. This PR should simply add the _wp_apply_block_content_filters function and unit tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunately, this test fails because the code for the new blocks is not yet reflected in this PR. Perhaps the _wp_apply_block_content_filters() function itself should be tested in this PR?

@t-hamano

Copy link
Copy Markdown
Contributor

I have removed the unit tests from this PR. This PR needs to be committed before today's Gutenberg sync, otherwise the non-existent _wp_apply_content_filters function will be executed during server-side rendering of blocks, causing a critical error. If no one else can review it, I will commit it myself before the Gutenberg sync.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@t-hamano t-hamano marked this pull request as ready for review July 14, 2026 06:10
@github-actions

github-actions Bot commented Jul 14, 2026

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props get_dave, wildworks, scruffian.

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

pento pushed a commit that referenced this pull request Jul 14, 2026
Introduce the private `_wp_apply_block_content_filters()` function so that blocks rendering full post content, such as Latest Posts, process it through the standard content pipeline with optional recursion protection, instead of outputting raw block markup.

Discussed in: #12421

Props get_dave, wildworks.
See #65586.


git-svn-id: https://develop.svn.wordpress.org/trunk@62726 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 14, 2026
Introduce the private `_wp_apply_block_content_filters()` function so that blocks rendering full post content, such as Latest Posts, process it through the standard content pipeline with optional recursion protection, instead of outputting raw block markup.

Discussed in: WordPress/wordpress-develop#12421

Props get_dave, wildworks.
See #65586.

Built from https://develop.svn.wordpress.org/trunk@62726


git-svn-id: http://core.svn.wordpress.org/trunk@62010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@getdave getdave force-pushed the backport-gutenberg-pr-74866 branch from 990eecd to 5095a4f Compare July 15, 2026 10:23

@scruffian scruffian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for working on this

@getdave

getdave commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@getdave @scruffian @MaggieCabrera, Is it possible to move this PR forward to meet the Beta 1 deadline? At a minimum, the changes in the following two files need to be reverted, as they are automatically synchronized from Gutenberg.

  • src/wp-includes/blocks/latest-posts.php
  • src/wp-includes/blocks/template-part.php

Apologies but I somehow missed this ping. I really appreciate you wrangling this here 🙇

@getdave

getdave commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@getdave getdave closed this Jul 15, 2026
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.

3 participants