Make WordPress Core

Ticket #59086: 59086.diff

File 59086.diff, 1.5 KB (added by poena, 13 months ago)

Add a condition that changes the body text color CSS selector depending on theme version, solve JavaScript warning in the editor.

  • src/wp-content/themes/twentytwenty/functions.php

     
    435435}
    436436
    437437add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     438add_action( 'enqueue_block_assets', 'twentytwenty_block_editor_styles', 1, 1 );
    438439
    439440/**
    440441 * Enqueue classic editor styles.
  • src/wp-content/themes/twentytwenty/inc/custom-css.php

     
    145145
    146146                        // Text color.
    147147                        if ( $body && $body !== $body_default ) {
    148                                 twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
     148                                if ( version_compare( $GLOBALS['wp_version'], '6.3', '<' ) ) {
     149                                        twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
     150                                } else {
     151                                        twentytwenty_generate_css( '.editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
     152                                }
    149153                        }
    150154
    151155                        // Secondary color.