Make WordPress Core

Ticket #59086: 59086-2.diff

File 59086-2.diff, 1.9 KB (added by poena, 13 months ago)

Use enqueue_block_assets or enqueue_block_editor_assets depending on theme version

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

     
    433433        // Enqueue the editor script.
    434434        wp_enqueue_script( 'twentytwenty-block-editor-script', get_theme_file_uri( '/assets/js/editor-script-block.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), true );
    435435}
     436if ( version_compare( $GLOBALS['wp_version'], '6.3', '>=' ) && is_admin() ) {
     437        add_action( 'enqueue_block_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     438} else {
     439        add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     440}
    436441
    437 add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
    438 
    439442/**
    440443 * Enqueue classic editor styles.
    441444 *
  • 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.