Skip to content

Commit 68765e2

Browse files
committed
Lift initial empty assignment of $srcs and $ids to outer block loop.
1 parent f5beba3 commit 68765e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5310,6 +5310,8 @@ function get_post_galleries( $post, $html = true, $max_galleries = PHP_INT_MAX )
53105310
$gallery_depth = $processor->get_depth();
53115311
$has_inner_blocks = false;
53125312
$gallery_ids = $processor->allocate_and_return_parsed_attributes()['attrs']['ids'] ?? array();
5313+
$ids = array();
5314+
$srcs = array();
53135315

53145316
$html_chunks = array();
53155317
$top_chunks = array();
@@ -5345,8 +5347,6 @@ function get_post_galleries( $post, $html = true, $max_galleries = PHP_INT_MAX )
53455347
// New Gallery block format as an array.
53465348
if ( $has_inner_blocks ) {
53475349
// There are inner blocks and this is the first one; the loop above aborted at its opening.
5348-
$ids = array();
5349-
$srcs = array();
53505350

53515351
/**
53525352
* @todo Could avoid computation by tracking seen ids and only looking up the

0 commit comments

Comments
 (0)