Changeset 59775 for trunk/src/wp-includes/blocks/post-content.php
- Timestamp:
- 02/07/2025 03:44:07 PM (11 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/post-content.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-content.php
r58187 r59775 47 47 } 48 48 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 49 70 /** This filter is documented in wp-includes/post-template.php */ 50 71 $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) ); 51 72 unset( $seen_ids[ $post_id ] ); 73 74 remove_filter( 'the_content', 'remove_serialized_parent_block', 8 ); 52 75 53 76 if ( empty( $content ) ) {
Note: See TracChangeset
for help on using the changeset viewer.