[wp-trac] [WordPress Trac] #45919: Twenty Nineteen: Improve comments in `twentynineteen_setup`

WordPress Trac noreply at wordpress.org
Thu Jan 10 19:07:51 UTC 2019


#45919: Twenty Nineteen: Improve comments in `twentynineteen_setup`
---------------------------+-----------------------------
 Reporter:  laurelfulford  |      Owner:  (none)
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:  5.0.2
 Severity:  normal         |   Keywords:  needs-patch
  Focuses:                 |
---------------------------+-----------------------------
 Originally reported by @joyously in the Twenty Nineteen GitHub repo:

 The new interfaces for the editor should be clear and instructive. Many
 people will look to this theme for "How To" information.

 The comments need to indicate what the add_theme_support really does. The
 call for the old editor should be marked as such.

 Currently, it's a bit sparse:

 {{{
 // Add support for Block Styles.
 add_theme_support( 'wp-block-styles' );

 // Add support for full and wide align images.
 add_theme_support( 'align-wide' );

 // Add support for editor styles.
 add_theme_support( 'editor-styles' );

 // Enqueue editor styles.
 add_editor_style( 'style-editor.css' );

 // Editor color palette.
 add_theme_support(
         'editor-color-palette',
                 array(
                         array(
                                 'name'  => __( 'Primary Color',
 'twentynineteen' ),
                                         'slug'  => 'primary',
                                 'color' => twentynineteen_hsl_hex(
 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod(
 'primary_color_hue', 199 ), 100, 33 ),
                                 ),
                         )
                 );

 // Add support for responsive embedded content.
 add_theme_support( 'responsive-embeds' );
 }}}

 There is also a separate function for enqueuing `twentynineteen-editor-
 customizer-styles` which should have good comments. This handle name is
 questionable, because it is editor and customizer, so it's confusing. Does
 it need to say customizer?

 If I'm looking at this to figure out how to change my theme for the new
 editor, I can't really tell what's what.

 Copied over from: https://github.com/WordPress/twentynineteen/issues/634

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45919>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list