Skip to content

Commit

Permalink
Move variable definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwelcher committed Sep 17, 2024
1 parent 8cadba1 commit 92b8493
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -1687,10 +1687,11 @@ function resolve_pattern_blocks( $blocks ) {
* @return string Serialized block markup.
*/
function traverse_and_serialize_blocks( $blocks, $pre_callback = null, $post_callback = null ) {
$result = '';
$parent_block = null; // At the top level, there is no parent block to pass to the callbacks; yet the callbacks expect a reference.
$pre_callback_is_callable = is_callable( $pre_callback );
$pre_callback_is_callable = is_callable( $pre_callback );
$post_callback_is_callable = is_callable( $post_callback );
$result = '';
$parent_block = null; // At the top level, there is no parent block to pass to the callbacks; yet the callbacks expect a reference.

foreach ( $blocks as $index => $block ) {
if ( $pre_callback_is_callable ) {
$prev = 0 === $index
Expand Down

0 comments on commit 92b8493

Please sign in to comment.