Changeset 58578 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 06/26/2024 08:52:12 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r58561 r58578 1096 1096 ); 1097 1097 1098 $serialized_block = apply_block_hooks_to_content( $markup, get_post( $post->ID ), 'set_ignored_hooked_blocks_metadata' ); 1098 $existing_post = get_post( $post->ID ); 1099 // Merge the existing post object with the updated post object to pass to the block hooks algorithm for context. 1100 $context = (object) array_merge( (array) $existing_post, (array) $post ); 1101 $serialized_block = apply_block_hooks_to_content( $markup, $context, 'set_ignored_hooked_blocks_metadata' ); 1099 1102 $root_block = parse_blocks( $serialized_block )[0]; 1100 1103 … … 1109 1112 $ignored_hooked_blocks = array_unique( array_merge( $ignored_hooked_blocks, $existing_ignored_hooked_blocks ) ); 1110 1113 } 1111 update_post_meta( $post->ID, '_wp_ignored_hooked_blocks', json_encode( $ignored_hooked_blocks ) ); 1114 1115 if ( ! isset( $post->meta_input ) ) { 1116 $post->meta_input = array(); 1117 } 1118 $post->meta_input['_wp_ignored_hooked_blocks'] = json_encode( $ignored_hooked_blocks ); 1112 1119 } 1113 1120
Note: See TracChangeset
for help on using the changeset viewer.