Skip to content

Commit

Permalink
Editor: Fix render_duotone_support() to be compatible with enhanced p…
Browse files Browse the repository at this point in the history
…agination.

Some blocks do not have content. For duotone support, blocks without content still need to run through the `render_duotone_support()` to render their duotone CSS.

This fix makes the duotone compatible with the enhanced pagination (introduced in 6.4.0) by making sure that the CSS is always on the page, even when the posts have no featured image. It also prevents the duotone from interfering with other blocks using `wp_unique_id()`.


References:
* [WordPress/gutenberg#55415 Gutenberg PR 55415]

Follow-up to [56226].

Props cbravobernal, luisherranz, hellofromTonya, isabel_brison, jorbin.
Fixes #59694.
Built from https://develop.svn.wordpress.org/trunk@56991


git-svn-id: https://core.svn.wordpress.org/trunk@56502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
hellofromtonya committed Oct 23, 2023
1 parent 4d9a529 commit c519e56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wp-includes/class-wp-duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ private static function get_all_global_style_block_names() {
* @return string Filtered block content.
*/
public static function render_duotone_support( $block_content, $block, $wp_block ) {
if ( empty( $block_content ) || ! $block['blockName'] ) {
if ( ! $block['blockName'] ) {
return $block_content;
}
$duotone_selector = self::get_selector( $wp_block->block_type );
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-56990';
$wp_version = '6.5-alpha-56991';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit c519e56

Please sign in to comment.