mirror of
git://develop.git.wordpress.org/
synced 2025-02-22 23:54:09 +01:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51472 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
211d94b710
commit
3f83b50743
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user