Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#60779 closed enhancement (fixed)

Twenty Twenty: use $theme_version variable for font stylesheet

Reported by: sabernhardt Owned by: SergeyBiryukov
Priority: normal Milestone: 6.6
Component: Bundled Theme Version:
Severity: minor Keywords: has-patch
Cc: Focuses:

Description

When [57311] added a font stylesheet,
wp_get_theme()->get( 'Version' )
identified the theme version within wp_enqueue_style().

  1. twentytwenty_register_styles() already has a $theme_version variable for use with other stylesheets, and it could be reused.
  2. twentytwenty_block_editor_styles() is the only function that includes wp_get_theme()->get( 'Version' ) without declaring the variable, and now the function uses it twice.
  3. twentytwenty_register_scripts() and twentytwenty_customize_preview_init() have the variable but only use it once each.

Attachments (1)

60779.diff​ (1.9 KB ) - added by sabernhardt 3 years ago.
uses $theme_version variable in twentytwenty_register_styles() and adds the variable in twentytwenty_block_editor_styles()

Download all attachments as: .zip

Change History (4)

@sabernhardt
3 years ago

uses $theme_version variable in twentytwenty_register_styles() and adds the variable in twentytwenty_block_editor_styles()

#1 @sabernhardt
3 years ago

  • Keywords has-patch added

For 60779.diff​, I chose consistency. With that, all five of the enqueuing functions declare and use the $theme_version variable.

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review → 6.6

#3 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 57842:

Twenty Twenty: Use the $theme_version variable for font stylesheet.

This aims to bring more consistency with the other wp_enqueue_style() calls in the theme's functions.

Follow-up to [57311].

Props sabernhardt.
Fixes #60779.

Note: See TracTickets for help on using tickets.