Make WordPress Core

Ticket #58835: tt1-darkmode.diff

File tt1-darkmode.diff, 1.5 KB (added by poena, 10 months ago)

Replace enqueue_block_editor_assets with enqueue_block_assets

  • src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php

     
    2323                add_action( 'wp_enqueue_scripts', array( $this, 'custom_color_variables' ) );
    2424
    2525                // Enqueue color variables for editor.
    26                 add_action( 'enqueue_block_editor_assets', array( $this, 'editor_custom_color_variables' ) );
    27 
     26                add_action( 'enqueue_block_assets', array( $this, 'editor_custom_color_variables' ) );
     27       
    2828                // Add body-class if needed.
    2929                add_filter( 'body_class', array( $this, 'body_class' ) );
    3030        }
  • src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php

     
    2020        public function __construct() {
    2121
    2222                // Enqueue assets for the block-editor.
    23                 add_action( 'enqueue_block_editor_assets', array( $this, 'editor_custom_color_variables' ) );
     23                add_action( 'enqueue_block_assets', array( $this, 'editor_custom_color_variables' ) );
    2424
    2525                // Add styles for dark-mode.
    2626                add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );