Opened 8 years ago
Closed 11 months ago
#46288 closed defect (bug) (worksforme)
'get_extended' breaks when using 'more' gutenberg block
| Reported by: | joewebber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 5.0 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
'get_extended' returns the closing tag <!-- /wp:more -->' in the extended content, which prevents 'the_content' filter from working correctly.
Steps to replicate:
<?php // Fetch post content $content = get_post_field('post_content', get_the_ID()); // Get content parts $content_parts = get_extended($content); echo apply_filters('the_content', $content_parts['extended']);
Quick workaround (wp-includes/post.php line: 592):
<?php $post = str_replace('<!-- /wp:more -->', '<!-- /more -->', $post);
Change History (3)
#1
@
7 years ago
- Keywords needs-patch added
- Milestone Awaiting Review → Future Release
- Version 5.0.3 → 5.0
This ticket was mentioned in Slack in #core by sirlouen. View the logs.
11 months ago
#3
@
11 months ago
- Milestone Future Release
- Resolution → worksforme
- Status new → closed
Reproduction Report
Description
❌ This report can't validate that the issue can be reproduced.
Environment
- WordPress: 6.9-beta2-61080
- PHP: 8.2.29
- Server: nginx/1.29.3
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 141.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty 2.9
- MU Plugins:
- WooCommerce Analytics - Proxy Speed Module 1.0.0
- Plugins:
- Classic Editor 1.6.7
- Test Reports 1.2.0
Testing Instructins
- Added the code to
singular.phptemplate. - Switched to Classic Editor
- Created a new post with content
- Added a
<!--more-->in the middle of the content - 👌 Extended section is rendering in the page template as expected
- Switched back to Gutenberg
- Converted text into blocks, including the
moretags. - 👌 Again, extended section is rendering in the page template as expected
Actual Results
- ❌ Error condition is not occurring.
Additional Notes
- It seems that this issue is not reproducible anymore. I'm not sure how this was being generated in gutenberg back in the day, but the current, processes a regular
moretag within twowp:more` tags like
<!-- wp:more --> <!--more--> <!-- /wp:more -->
I'm not sure if this has influenced in the current valid result, but probably. Closing this as worksforme
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #46471.