summaryrefslogtreecommitdiffstats
path: root/wp-includes/class-wp-theme-json-data.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:18 +0000
commit0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch)
treee139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/class-wp-theme-json-data.php
parentAdding upstream version 6.5.5+dfsg1. (diff)
downloadwordpress-upstream.tar.xz
wordpress-upstream.zip
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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;
+ }
}