Changeset 60189 for branches/6.8/src/wp-includes/blocks.php
- Timestamp:
- 04/25/2025 07:21:31 PM (7 weeks ago)
- Location:
- branches/6.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.8
-
branches/6.8/src/wp-includes/blocks.php
r59938 r60189 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.