WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 4 months ago

#46288 new defect (bug)

'get_extended' breaks when using 'more' gutenberg block

Reported by: joewebber Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0
Component: Posts, Post Types Keywords: needs-patch
Focuses: Cc:

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

#1 @pento
4 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 5.0.3 to 5.0

Related: #46471.

Note: See TracTickets for help on using tickets.