On this page
WP_Theme_JSON_Resolver::translate_theme_json_chunk( array $array_to_translate, string $key, string $context, string $domain ): array
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Translates a chunk of the loaded theme.json structure.
Parameters
$array_to_translatearray Required-
The chunk of theme.json to translate.
$keystring Required-
The key of the field that contains the string to translate.
$contextstring Required-
The context to apply in the translation call.
$domainstring Required-
Text domain. Unique identifier for retrieving translated strings.
Return
array Returns the modified $theme_json chunk.
Source
File: wp-includes/class-wp-theme-json-resolver.php. View all references
* @return WP_Theme_JSON Entity that holds core data.
*/
public static function get_core_data() {
if ( null !== static::$core && static::has_same_registered_blocks( 'core' ) ) {
return static::$core;
}
$config = static::read_json_file( __DIR__ . '/theme.json' );
$config = static::translate( $config );
/**
* Filters the default data provided by WordPress for global styles & settings.
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/translate_theme_json_chunk