From 2c3326126b4fc01775760ca83e5eb975e09093b7 Mon Sep 17 00:00:00 2001 From: desrosj Date: Fri, 30 Jul 2021 12:22:00 +0000 Subject: [PATCH] I18n: Fix broken loop in `WP_Theme_JSON_Resolver` Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/33552. The loop in `WP_Theme_JSON_Resolver` to extract translatable paths was broken, as it contained an immediate and unconditional return. This caused the loop to immediately exit again after the first iteration, thus never actually looping. Follow-up to [50959]. Props schlessera. Merges [51472] to the 5.8 branch. Fixes #53738. Built from https://develop.svn.wordpress.org/branches/5.8@51515 git-svn-id: http://core.svn.wordpress.org/branches/5.8@51126 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json-resolver.php | 11 +++++------ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/wp-includes/class-wp-theme-json-resolver.php b/wp-includes/class-wp-theme-json-resolver.php index 23d4eb0f61..39354106f2 100644 --- a/wp-includes/class-wp-theme-json-resolver.php +++ b/wp-includes/class-wp-theme-json-resolver.php @@ -121,14 +121,13 @@ class WP_Theme_JSON_Resolver { foreach ( $i18n_partial as $property => $partial_child ) { if ( is_numeric( $property ) ) { foreach ( $partial_child as $key => $context ) { - return array( - array( - 'path' => $current_path, - 'key' => $key, - 'context' => $context, - ), + $result[] = array( + 'path' => $current_path, + 'key' => $key, + 'context' => $context, ); } + return $result; } $result = array_merge( $result, diff --git a/wp-includes/version.php b/wp-includes/version.php index 139a336f22..85a0b929fe 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8.1-alpha-51509'; +$wp_version = '5.8.1-alpha-51515'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.