Skip to content

Commit da9bb5d

Browse files
committed
Move static var declaration to start of function
1 parent b931185 commit da9bb5d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-includes/blocks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,8 @@ function apply_block_hooks_to_content( $content, $context = null, $callback = 'i
11261126
}
11271127

11281128
$suppress_single_instance_blocks = static function ( $hooked_block_types, $relative_position, $anchor_block_type ) use ( &$block_allows_multiple_instances, $content, $context ) {
1129+
static $single_instance_blocks_present_in_content = array();
1130+
11291131
/*
11301132
* If the context is a post object, we need to avoid inserting any blocks hooked into the
11311133
* `before` and `after` positions of the temporary wrapper block that we create to wrap the content.
@@ -1151,7 +1153,6 @@ function apply_block_hooks_to_content( $content, $context = null, $callback = 'i
11511153
* We also need to cover the case where a hooked block with `multiple: false` is not
11521154
* present in `$content` at first and we're allowed to insert it once -- but not again.
11531155
*/
1154-
static $single_instance_blocks_present_in_content = array();
11551156
foreach ( $hooked_block_types as $index => $hooked_block_type ) {
11561157
if ( ! isset( $block_allows_multiple_instances[ $hooked_block_type ] ) ) {
11571158
$hooked_block_type_definition =

0 commit comments

Comments
 (0)