We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5641287 commit 26e3640Copy full SHA for 26e3640
src/plugins/theme-block-style-inheritance/index.php
@@ -74,7 +74,14 @@ function add_block_style_inheritance( $current_css ) {
74
$styles_data = new WP_Theme_JSON();
75
$styles_data->merge( WP_Theme_JSON_Resolver::get_theme_data() );
76
$styles_data->merge( WP_Theme_JSON_Resolver::get_user_data() );
77
- $styles = $styles_data->get_raw_data()['styles'];
+ $raw_data = $styles_data->get_raw_data();
78
+
79
+ // Don't generate styles if it's not a block theme/there's no theme.json
80
+ if ( ! isset( $raw_data[ 'styles' ] ) ) {
81
+ return;
82
+ }
83
84
+ $styles = $raw_data['styles'];
85
} else {
86
// This gets the merged styles from core, theme, and user data
87
$styles = wp_get_global_styles();
0 commit comments