WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 9 months ago

#45919 new enhancement

Twenty Nineteen: Improve comments in `twentynineteen_setup`

Reported by: laurelfulford Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0.2
Component: Bundled Theme Keywords: needs-patch
Focuses: Cc:
PR Number:

Description

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

Change History (1)

#1 @laurelfulford
9 months ago

  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.