Make WordPress Core

Ticket #59086: 59086.3.diff

File 59086.3.diff, 1.6 KB (added by sabernhardt, 13 months ago)

switch body to html, and use enqueue_block_assets action with 6.3

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

     
    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}
    436436
    437 add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     437if ( is_admin() && version_compare( $GLOBALS['wp_version'], '6.3', '>=' ) ) {
     438        add_action( 'enqueue_block_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     439} else {
     440        add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
     441}
    438442
    439443/**
    440444 * 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                                twentytwenty_generate_css( 'html .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
    149149                        }
    150150
    151151                        // Secondary color.