From 6234fd90c23c394a7d185ec2abc87e8f27f2c421 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 18 Feb 2020 15:49:08 +0000 Subject: [PATCH] Theme Editor: Disable CodeMirror CSS linting. Being a good idea in theory, in practice it does not always work reliably, may not recognize newer CSS properties, and sometimes displays phantom errors with no particular error message. A plugin can re-enable CSS linting via the `wp_code_editor_settings` filter. Props skypressatx, ThemeZee, johnbillion, ianbelanger, ZanderZ, starvoters1, raoulunger, prashantvatsh, SergeyBiryukov. Fixes #44471. git-svn-id: https://develop.svn.wordpress.org/trunk@47305 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 96917c7c59..8c86ed7f92 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -3721,17 +3721,7 @@ function wp_get_code_editor_settings( $args ) { } } - if ( 'text/css' === $type ) { - $settings['codemirror'] = array_merge( - $settings['codemirror'], - array( - 'mode' => 'css', - 'lint' => true, - 'autoCloseBrackets' => true, - 'matchBrackets' => true, - ) - ); - } elseif ( 'text/x-scss' === $type || 'text/x-less' === $type || 'text/x-sass' === $type ) { + if ( in_array( $type, array( 'text/css', 'text/x-scss', 'text/x-less', 'text/x-sass' ), true ) ) { $settings['codemirror'] = array_merge( $settings['codemirror'], array(