Make WordPress Core


Ignore:
Timestamp:
10/23/2023 11:37:55 PM (15 months ago)
Author:
hellofromTonya
Message:

Editor: Fix render_duotone_support() to be compatible with enhanced pagination.

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:

Follow-up to [56226].

Props cbravobernal, luisherranz, hellofromTonya, isabel_brison, jorbin.
Fixes #59694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-duotone.php

    r56709 r56991  
    10751075     */
    10761076    public static function render_duotone_support( $block_content, $block, $wp_block ) {
    1077         if ( empty( $block_content ) || ! $block['blockName'] ) {
     1077        if ( ! $block['blockName'] ) {
    10781078            return $block_content;
    10791079        }
Note: See TracChangeset for help on using the changeset viewer.