summaryrefslogtreecommitdiffstats
path: root/wp-includes/class-wp-theme-json-data.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/class-wp-theme-json-data.php')
-rw-r--r--wp-includes/class-wp-theme-json-data.php13
1 files changed, 12 insertions, 1 deletions
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;
+ }
}