Skip to content

Commit 26e3640

Browse files
committed
fix php error
1 parent 5641287 commit 26e3640

File tree

1 file changed

+8
-1
lines changed
  • src/plugins/theme-block-style-inheritance

1 file changed

+8
-1
lines changed

src/plugins/theme-block-style-inheritance/index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ function add_block_style_inheritance( $current_css ) {
7474
$styles_data = new WP_Theme_JSON();
7575
$styles_data->merge( WP_Theme_JSON_Resolver::get_theme_data() );
7676
$styles_data->merge( WP_Theme_JSON_Resolver::get_user_data() );
77-
$styles = $styles_data->get_raw_data()['styles'];
77+
$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'];
7885
} else {
7986
// This gets the merged styles from core, theme, and user data
8087
$styles = wp_get_global_styles();

0 commit comments

Comments
 (0)