Make WordPress Core

Opened 8 months ago

Last modified 4 weeks ago

#63909 accepted defect (bug)

Automatic excerpts: support lists in addition to columns and groups

Reported by: jeherve's profile jeherve Owned by: audrasjb's profile audrasjb
Milestone: 7.1 Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: has-patch has-unit-tests
Focuses: Cc:

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 (6)

This ticket was mentioned in PR #9704 on WordPress/wordpress-develop by @jeherve.


8 months ago
#1

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

#2 @SirLouen
8 months ago

  • Component changed from Posts, Post Types to Editor

#3 @audrasjb
5 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 7.1

Good point. The propose PR looks good to me, milestoning it to 7.1.

#4 @audrasjb
5 weeks ago

  • Owner set to audrasjb
  • Status changed from new to accepted

This ticket was mentioned in Slack in #core-test by gaisma22. View the logs.


4 weeks ago

#6 @gaisma22
4 weeks 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

  1. Created a new post using a List block with three items.
  2. Published without a custom excerpt.
  3. 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.
  4. 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

  1. Bug confirmed on WordPress 7.0-beta6. List block content was completely ignored when generating automatic excerpts.
  2. After the patch, list content is correctly extracted and included in the excerpt.
  3. Removing needs-testing as patch resolves the issue on WordPress 7.0-beta6-62085-src.

Screenshots/Screencast with results

Before Patch:
https://i.ibb.co/P7tcttk/before-excerpt.png

After Patch:
https://i.ibb.co/LXRLsr17/after-excerpt.png

Note: See TracTickets for help on using tickets.