From 2f4caf4ae55e172fe814f8f1cc11ca11ff4e30cb Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 25 Mar 2021 21:32:07 +0000 Subject: [PATCH] Global Styles: Make theme.json extensible --- lib/class-wp-theme-json-resolver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/class-wp-theme-json-resolver.php b/lib/class-wp-theme-json-resolver.php index e3a2a2a0e84d60..f54322fa827d34 100644 --- a/lib/class-wp-theme-json-resolver.php +++ b/lib/class-wp-theme-json-resolver.php @@ -57,7 +57,7 @@ class WP_Theme_JSON_Resolver { * * @return array Contents that adhere to the theme.json schema. */ - private static function read_json_file( $file_path ) { + public static function read_json_file( $file_path ) { $config = array(); if ( $file_path ) { $decoded_file = json_decode( @@ -309,6 +309,7 @@ public static function get_core_data() { public static function get_theme_data( $theme_support_data = array() ) { if ( null === self::$theme ) { $theme_json_data = self::read_json_file( self::get_file_path_from_theme( 'experimental-theme.json' ) ); + $theme_json_data = apply_filters( 'theme_json_data', $theme_json_data ); $theme_json_data = self::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) ); self::$theme = new WP_Theme_JSON( $theme_json_data ); }