From fc0a79914946dac00ccd51b1aacffe267de7210e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 19 Sep 2024 06:51:22 +0200 Subject: Merging upstream version 6.6.1+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/class-wp-theme-json-data.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'wp-includes/class-wp-theme-json-data.php') diff --git a/wp-includes/class-wp-theme-json-data.php b/wp-includes/class-wp-theme-json-data.php index 6aa8a39..ca72ae8 100644 --- a/wp-includes/class-wp-theme-json-data.php +++ b/wp-includes/class-wp-theme-json-data.php @@ -39,7 +39,7 @@ class WP_Theme_JSON_Data { * @param array $data Array following the theme.json specification. * @param string $origin The origin of the data: default, theme, user. */ - public function __construct( $data = array(), $origin = 'theme' ) { + public function __construct( $data = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA ), $origin = 'theme' ) { $this->origin = $origin; $this->theme_json = new WP_Theme_JSON( $data, $this->origin ); } @@ -69,4 +69,15 @@ class WP_Theme_JSON_Data { public function get_data() { return $this->theme_json->get_raw_data(); } + + /** + * Returns theme JSON object. + * + * @since 6.6.0 + * + * @return WP_Theme_JSON The theme JSON structure stored in this data object. + */ + public function get_theme_json() { + return $this->theme_json; + } } -- cgit v1.2.3