Make WordPress Core

Changeset 47305


Ignore:
Timestamp:
02/18/2020 03:49:08 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r47287 r47305  
    37223722    }
    37233723
    3724     if ( 'text/css' === $type ) {
    3725         $settings['codemirror'] = array_merge(
    3726             $settings['codemirror'],
    3727             array(
    3728                 'mode'              => 'css',
    3729                 'lint'              => true,
    3730                 'autoCloseBrackets' => true,
    3731                 'matchBrackets'     => true,
    3732             )
    3733         );
    3734     } elseif ( 'text/x-scss' === $type || 'text/x-less' === $type || 'text/x-sass' === $type ) {
     3724    if ( in_array( $type, array( 'text/css', 'text/x-scss', 'text/x-less', 'text/x-sass' ), true ) ) {
    37353725        $settings['codemirror'] = array_merge(
    37363726            $settings['codemirror'],
Note: See TracChangeset for help on using the changeset viewer.