From 69ead0f406f2ad6ec0289f337431d2fc4c554261 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 25 Jun 2021 15:31:21 +0000 Subject: [PATCH] Block Editor: Do not load a default font family for themes with theme.json. This matches the behavior that has been in place in the gutenberg plugin. The idea is that this makes the editor match the frontend by default for these themes. If they use a custom font, they'll have to provide it for the editor as editor styles. Props nosolosw. git-svn-id: https://develop.svn.wordpress.org/trunk@51240 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-editor.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php index ffa83229dc..d2bf4cee7d 100644 --- a/src/wp-includes/block-editor.php +++ b/src/wp-includes/block-editor.php @@ -470,12 +470,17 @@ function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont function get_block_editor_theme_styles() { global $editor_styles; - $styles = array( - array( - 'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }', - '__unstableType' => 'core', - ), - ); + if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { + $styles = array( + array( + 'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }', + '__unstableType' => 'core', + ), + ); + } else { + $styles = array(); + } + if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) { foreach ( $editor_styles as $style ) { if ( preg_match( '~^(https?:)?//~', $style ) ) {