Opened 12 months ago
Last modified 7 days ago
#63909 accepted defect (bug)
Automatic excerpts: support lists in addition to columns and groups
| Reported by: | jeherve | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Editor | Version: | 6.1 |
| Severity: | normal | Keywords: | has-patch has-unit-tests 2nd-opinion commit |
| Cc: | Focuses: |
Description
In #53604, we made some changes so when automatically generating an excerpt from post content, we would better consider content inside inner blocks. r51382 added support for two main wrappers used in Core to house inner blocks: columns and groups.
I would like to suggest adding support for another commonly used wrapper in core: lists. This way, content from lists would be pulled in excerpts when possible.
Change History (15)
This ticket was mentioned in PR #9704 on WordPress/wordpress-develop by @jeherve.
12 months ago
#1
#3
@
4 months ago
- Keywords needs-testing added
- Milestone Awaiting Review → 7.1
Good point. The propose PR looks good to me, milestoning it to 7.1.
This ticket was mentioned in Slack in #core-test by gaisma22. View the logs.
4 months ago
#6
@
4 months ago
- Keywords needs-testing removed
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/9704
Environment
- WordPress: 7.0-beta6-62085-src
- PHP: 8.3.30
- Server: nginx/1.29.7
- Database: MySQL 8.4.8
- Browser: Brave
- OS: Ubuntu 24.04
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None
- Plugins: None
Steps Taken
- Created a new post using a List block with three items.
- Published without a custom excerpt.
- Checked the generated excerpt via the REST API at /wp-json/wp/v2/posts/13. Before patch: excerpt.rendered was completely empty. List content was not pulled into the excerpt at all.
- Applied PR #9704 and created a new post with the same steps. Checked /wp-json/wp/v2/posts/15. After patch: List items appear correctly in the excerpt.
✅ Patch is solving the problem
Expected Result
When WordPress generates an automatic excerpt from a post using a List block, the list item content should be included in the generated excerpt.
Additional Notes
- Bug confirmed on WordPress 7.0-beta6. List block content was completely ignored when generating automatic excerpts.
- After the patch, list content is correctly extracted and included in the excerpt.
- Removing
needs-testingas patch resolves the issue on WordPress 7.0-beta6-62085-src.
Screenshots/Screencast with results
This ticket was mentioned in Slack in #core-test by noruzzaman. View the logs.
2 weeks ago
#9
@
2 weeks ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/9704
Environment
- WordPress: 7.1-beta4-62899-src
- Subdirectory: No
- PHP: 8.3.32
- Server: nginx/1.31.3
- Database: mysqli (Server: 9.7.2 / Client: mysqlnd 8.3.32)
- Browser: Chrome 150.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Test Reports 1.3.0
Steps taken
- Started with a clean WordPress 7.1-beta4 installation.
- Created a new post.
- Added a List block.
- Entered three list items:
- Test 1
- Test 2
- Test 3
- Published the post without setting a manual excerpt.
- Retrieved the post using the REST API endpoint (
/wp-json/wp/v2/posts/<post-id>). - Confirmed that before applying the patch, the automatically generated excerpt was empty:
"excerpt": {
"rendered": "",
"protected": false
}
- Applied PR #9704.
- Reloaded the same REST API endpoint.
- Confirmed that the automatically generated excerpt now includes the List block content:
"excerpt": {
"rendered": "\u003Cp\u003ETest 1 Test 2 Test 3\u003C/p\u003E\n",
"protected": false
}
✅ Patch is solving the problem.
Expected result
- Content inside the List block should be included when WordPress automatically generates a post excerpt.
- The generated excerpt should be available through the REST API instead of returning an empty string.
Screenshots/Screencast with results
Video Demonstration
This ticket was mentioned in Slack in #core-test by huzaifaalmesbah. View the logs.
2 weeks ago
#11
@
2 weeks ago
- Version 5.8 → 6.1
The cause of this issue is a regression introduced by the refactoring of the List block using inner blocks. When Gutenberg PR 42711 was merged, the logic for excerpt_remove_blocks() should have been updated simultaneously, but this was overlooked.
My understanding is that since WordPress 6.1, list blocks have never appeared in excerpts. PR 9704 certainly fixes a bug, and I'm personally fine with it shipping in 7.1, but I think we should be aware that it changes the excerpt output behavior that has been the same for several years and also changes the default values of the excerpt_allowed_wrapper_blocks() and excerpt_allowed_blocks() filters.
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
11 days ago
#14
@
11 days ago
- Milestone 7.1 → 7.2
If I understand this correctly, list blocks did appear in excerpts prior to the refactor, and lists always appeared in excerpts prior to the block editor. However, for any *recent* generated excerpts, list items would be missing, and adding them could be a notable change for users.
While I still think that this change should be made, as it's more predictable, I don't think it should be made at the last minute before RC, so I'm going to punt this to 7.2.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)


In #53604, we made some changes so when automatically generating an excerpt from post content, we would better consider content inside inner blocks. r51382 added support for two main wrappers used in Core to house inner blocks: columns and groups.
This commit adds support for another commonly used wrapper in core: lists. This way, content from lists would be pulled in excerpts when possible.
Trac ticket: https://core.trac.wordpress.org/ticket/63909