Make WordPress Core


Ignore:
Timestamp:
02/07/2025 03:44:07 PM (11 months ago)
Author:
joemcgill
Message:

Editor: Update packages for 6.8 pre-Betas.

Syncs @wordpress/* packages to the 'latest' npm tag.

Props mamaduka, joemcgill, youknowriad, swissspidy, sergiomdgomes, gziolo.
See #62887.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/post-content.php

    r58187 r59775  
    4747    }
    4848
     49    $ignored_hooked_blocks = get_post_meta( $post_id, '_wp_ignored_hooked_blocks', true );
     50    if ( ! empty( $ignored_hooked_blocks ) ) {
     51        $ignored_hooked_blocks  = json_decode( $ignored_hooked_blocks, true );
     52        $attributes['metadata'] = array(
     53            'ignoredHookedBlocks' => $ignored_hooked_blocks,
     54        );
     55    }
     56
     57    // Wrap in Post Content block so the Block Hooks algorithm can insert blocks
     58    // that are hooked as first or last child of `core/post-content`.
     59    $content = get_comment_delimited_block_content(
     60        'core/post-content',
     61        $attributes,
     62        $content
     63    );
     64
     65    // We need to remove the `core/post-content` block wrapper after the Block Hooks algorithm,
     66    // but before `do_blocks` runs, as it would otherwise attempt to render the same block again --
     67    // thus recursing infinitely.
     68    add_filter( 'the_content', 'remove_serialized_parent_block', 8 );
     69
    4970    /** This filter is documented in wp-includes/post-template.php */
    5071    $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
    5172    unset( $seen_ids[ $post_id ] );
     73
     74    remove_filter( 'the_content', 'remove_serialized_parent_block', 8 );
    5275
    5376    if ( empty( $content ) ) {
Note: See TracChangeset for help on using the changeset viewer.