Changeset 60173 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 04/18/2025 12:55:40 PM (10 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r59938 r60173 1249 1249 ); 1250 1250 1251 /* 1252 * We need to avoid inserting any blocks hooked into the `before` and `after` positions 1253 * of the temporary wrapper block that we create to wrap the content. 1254 * See https://core.trac.wordpress.org/ticket/63287 for more details. 1255 */ 1256 $suppress_blocks_from_insertion_before_and_after_wrapper_block = static function ( $hooked_block_types, $relative_position, $anchor_block_type ) use ( $wrapper_block_type ) { 1257 if ( 1258 $wrapper_block_type === $anchor_block_type && 1259 in_array( $relative_position, array( 'before', 'after' ), true ) 1260 ) { 1261 return array(); 1262 } 1263 return $hooked_block_types; 1264 }; 1265 1251 1266 // Apply Block Hooks. 1267 add_filter( 'hooked_block_types', $suppress_blocks_from_insertion_before_and_after_wrapper_block, PHP_INT_MAX, 3 ); 1252 1268 $content = apply_block_hooks_to_content( $content, $post, $callback ); 1269 remove_filter( 'hooked_block_types', $suppress_blocks_from_insertion_before_and_after_wrapper_block, PHP_INT_MAX ); 1253 1270 1254 1271 // Finally, we need to remove the temporary wrapper block.
Note: See TracChangeset
for help on using the changeset viewer.