Skip to content

Commit

Permalink
Account for changes in __unstableType in WordPress core
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Feb 10, 2022
1 parent 3fbca90 commit 67001f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ function_exists( 'gutenberg_is_edit_site_page' ) &&
// Reset existing global styles.
$styles_without_existing_global_styles = array();
foreach ( $settings['styles'] as $style ) {
if ( ! isset( $style['__unstableType'] ) || 'globalStyles' !== $style['__unstableType'] ) {
if (
! isset( $style['__unstableType'] ) ||
// 'globalStyles' is for WordPress 5.8. 'theme' and 'presets' is for WordPress 5.9.
! in_array( $style['__unstableType'], array( 'globalStyles', 'theme', 'presets' ), true )
) {
$styles_without_existing_global_styles[] = $style;
}
}
Expand Down

0 comments on commit 67001f9

Please sign in to comment.