Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

#60779 closed enhancement (fixed)

Twenty Twenty: use $theme_version variable for font stylesheet

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

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 4 weeks 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
4 weeks ago

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

#1 @sabernhardt
4 weeks 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
4 weeks ago

  • Milestone changed from Awaiting Review to 6.6

#3 @SergeyBiryukov
4 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to 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.