diff --git a/lib/global-styles.php b/lib/global-styles.php index 10f10acb4d5a08..013fdb11190e5e 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -134,6 +134,12 @@ function_exists( 'gutenberg_is_edit_site_page' ) && '__experimentalNoWrapper' => true, ); + // Make sure the styles array exists. + // In some contexts, like the navigation editor, it doesn't. + if ( ! isset( $settings['styles'] ) ) { + $settings['styles'] = array(); + } + // Reset existing global styles. foreach ( $settings['styles'] as $key => $style ) { if ( isset( $style['__unstableType'] ) && 'globalStyles' === $style['__unstableType'] ) {