Skip to content

Commit

Permalink
Global Styles: Skip registration of variation styles when unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 13, 2024
1 parent 1e829be commit 450576e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/block-supports/block-style-variations.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ function gutenberg_register_block_style_variations_from_theme_json_data( $variat
* @access private
*/
function gutenberg_register_block_style_variations_from_theme() {
// Skip any registration of styles if the theme doesn't support theme.json.
if ( ! wp_theme_has_theme_json() ) {
return;
}

// Partials from `/styles`.
$variations_partials = WP_Theme_JSON_Resolver_Gutenberg::get_style_variations( 'block' );
gutenberg_register_block_style_variations_from_theme_json_data( $variations_partials );
Expand Down

0 comments on commit 450576e

Please sign in to comment.