Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Fix Query Loop with excerpt outputting invalid HTML #41333

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Hotfix for a {Gutenberg 20.0.0, WP 6.7.x} bug causing the Content block to output truncated HTML.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,29 @@ function ( $args ) {
},
20
);

/**
* Hotfix for a {Gutenberg 20.0.0, WP 6.7.x} bug causing the Content block to output truncated HTML.
* See: https://github.com/WordPress/gutenberg/issues/68614
*/
if (
// WordPress 6.7.x contains the buggy remove_serialized_parent_block() function.
version_compare( get_bloginfo( 'version' ), '6.8', '<' ) ) {

add_filter(
'the_content',
function ( $content ) {
if ( has_filter( 'the_content', 'remove_serialized_parent_block' ) ) {
// We will revert the content manipulation done in https://github.com/WordPress/gutenberg/pull/67272.

// Reverts https://github.com/WordPress/gutenberg/pull/67272/files#diff-611d9e2b5a9b00eb2fbe68d044eccb195759a422e36f525186d43d752bee3d71R65-R68
remove_filter( 'the_content', 'remove_serialized_parent_block', 8 );

// Reverts https://github.com/WordPress/gutenberg/pull/67272/files#diff-611d9e2b5a9b00eb2fbe68d044eccb195759a422e36f525186d43d752bee3d71R57-R63
return remove_serialized_parent_block( $content );
}
return $content;
},
1
);
}
Loading