WP_Theme_JSON_Resolver::get_fields_to_translate()

Returns a data structure used in theme.json translation.

Return

(array) An array of theme.json fields that are translatable and the keys that are translatable.

Source

File: wp-includes/class-wp-theme-json-resolver.php

public static function get_fields_to_translate() {
		if ( null === self::$theme_json_i18n ) {
			$file_structure        = self::read_json_file( __DIR__ . '/theme-i18n.json' );
			self::$theme_json_i18n = self::extract_paths_to_translate( $file_structure );
		}
		return self::$theme_json_i18n;
	}

Changelog

Version Description
5.8.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_fields_to_translate