PluginProbe
Gutenberg / 17.0.2
Gutenberg v17.0.2
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | lib/class-wp-theme-json-data-gutenberg.php +5 -12 23.7.0 → 17.0.2 View file →
@@ -5,8 +5,12 @@
5 5 * @package gutenberg
6 6 * @since 6.1.0
7 7 */
8 8
9 +if ( class_exists( 'WP_Theme_JSON_Data_Gutenberg' ) ) {
10 + return;
11 +}
12 +
9 13 /**
10 14 * Class to provide access to update a theme.json structure.
11 15 */
12 16 #[AllowDynamicProperties]
@@ -37,9 +41,9 @@
37 41 *
38 42 * @param array $data Array following the theme.json specification.
39 43 * @param string $origin The origin of the data: default, theme, user.
40 44 */
41 - public function __construct( $data = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA ), $origin = 'theme' ) {
45 + public function __construct( $data = array(), $origin = 'theme' ) {
42 46 $this->origin = $origin;
43 47 $this->theme_json = new WP_Theme_JSON_Gutenberg( $data, $this->origin );
44 48 }
45 49
@@ -66,17 +70,6 @@
66 70 * @return array
67 71 */
68 72 public function get_data() {
69 73 return $this->theme_json->get_raw_data();
70 - }
71 -
72 - /**
73 - * Return theme JSON object.
74 - *
75 - * @since 18.5.0
76 - *
77 - * @return WP_Theme_JSON
78 - */
79 - public function get_theme_json() {
80 - return $this->theme_json;
81 74 }
82 75 }