[wp-trac] [WordPress Trac] #59086: Twenty Twenty Theme black background hides text editing after 6.3 update

WordPress Trac noreply at wordpress.org
Sun Aug 13 07:45:18 UTC 2023


#59086: Twenty Twenty Theme black background hides text editing after 6.3 update
---------------------------+---------------------
 Reporter:  floydwilde     |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  6.3.1
Component:  Bundled Theme  |     Version:  6.3
 Severity:  normal         |  Resolution:
 Keywords:  needs-refresh  |     Focuses:
---------------------------+---------------------

Comment (by poena):

 {{{twentytwenty_block_editor_styles()}}} adds a script and CSS for both
 blocks and the editor canvas itself.
 Because extenders may be using this function name already, I did not want
 to split it into multiple functions and enqueue these separately. So I
 added a version compare and an is_admin() conditional.

 @sabernhardt @greenshady does this make sense?


 {{{
 /**
  * Enqueue supplemental block editor styles.
  *
  * @since Twenty Twenty 1.0
  */
 function twentytwenty_block_editor_styles() {

         // Enqueue the editor styles.
         wp_enqueue_style( 'twentytwenty-block-editor-styles',
 get_theme_file_uri( '/assets/css/editor-style-block.css' ), array(),
 wp_get_theme()->get( 'Version' ), 'all' );
         wp_style_add_data( 'twentytwenty-block-editor-styles', 'rtl',
 'replace' );

         // Add inline style from the Customizer.
         $customizer_css = twentytwenty_get_customizer_css( 'block-editor'
 );
         if ( $customizer_css ) {
                 wp_add_inline_style( 'twentytwenty-block-editor-styles',
 $customizer_css );
         }

         // Add inline style for non-latin fonts.
         $custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css(
 'block-editor' );
         if ( $custom_css ) {
                 wp_add_inline_style( 'twentytwenty-block-editor-styles',
 $custom_css );
         }

         // Enqueue the editor script.
         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 );
 }

 if ( version_compare( $GLOBALS['wp_version'], '6.3', '>=' ) && is_admin()
 ) {
         add_action( 'enqueue_block_assets',
 'twentytwenty_block_editor_styles', 1, 1 );
 } else {
         add_action( 'enqueue_block_editor_assets',
 'twentytwenty_block_editor_styles', 1, 1 );
 }
 }}}


 Or maybe it should just be
 {{{
 if ( is_admin() ) {
         add_action( 'enqueue_block_assets',
 'twentytwenty_block_editor_styles', 1, 1 );
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59086#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list