Make WordPress Core


Ignore:
Timestamp:
07/06/2021 03:31:48 PM (4 years ago)
Author:
desrosj
Message:

Posts: Prevent an empty excerpt when groups and nested column blocks are present.

This improves the logic within excerpt_remove_blocks() to better handle innerBlocks. This prevents an empty excerpt from being returned when core/columns, core/column, and core/group blocks are present.

This issue has been surfaced in the Query Loop block, where excerpts can be set to display.

Props aristath.
Fixes #53604.

File:
1 edited

Legend:

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

    r50810 r51348  
    42084208    wp_strict_cross_origin_referrer();
    42094209}
     4210
     4211/**
     4212 * Render inner blocks from the `core/columns` block for generating an excerpt.
     4213 *
     4214 * @since 5.2.0
     4215 * @deprecated 5.8.0
     4216 *
     4217 * @access private
     4218 *
     4219 * @param array $columns        The parsed columns block.
     4220 * @param array $allowed_blocks The list of allowed inner blocks.
     4221 * @return string The rendered inner blocks.
     4222 */
     4223function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
     4224    _deprecated_function( __FUNCTION__, '5.8.0', '_excerpt_render_inner_blocks()' );
     4225    return _excerpt_render_inner_blocks( $columns, $allowed_blocks );
     4226}
Note: See TracChangeset for help on using the changeset viewer.