WP_Theme_JSON_Resolver::translate_theme_json_chunk( array $array_to_translate, string $key, string $context, string $domain ): array

In this article

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_translatearrayrequired
The chunk of theme.json to translate.
$keystringrequired
The key of the field that contains the string to translate.
$contextstringrequired
The context to apply in the translation call.
$domainstringrequired
Text domain. Unique identifier for retrieving translated strings.

Return

array Returns the modified $theme_json chunk.

Source

$config = static::translate( $config );

/**
 * Filters the default data provided by WordPress for global styles & settings.
 *
 * @since 6.1.0
 *
 * @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data.
 */
$theme_json   = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data( $config, 'default' ) );
$config       = $theme_json->get_data();
static::$core = new WP_Theme_JSON( $config, 'default' );

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.