Make WordPress Core

Opened 4 weeks ago

Closed 4 weeks ago

#64526 closed enhancement (fixed)

Twenty Twenty-One: consistently use theme version when enqueueing resources

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

Description

previously mentioned on PR 10493

Twenty Twenty-One uses wp_get_theme()->get( 'Version' ) for most of its styles and scripts, but three dark mode scripts have a string of 1.0.0.

The string could be changed to modified dates, as Twenty Ten through Twenty Seventeen use for their blocks.css and similar files. However, I prefer making the version consistent within the Twenty Twenty-One theme.

Attachments (1)

64526.diff (1.2 KB) - added by sabernhardt 4 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 @sabernhardt
4 weeks ago

  • In PR 773, all 4 dark mode resources used '1.0.0' as the version string.
  • [49574] switched the stylesheet to
    wp_enqueue_style( 'tt1-dark-mode', $url, array( 'twenty-twenty-one-style' ), wp_get_theme()->get( 'Version' ) ); // @phpstan-ignore-line. Version is always a string.

@sabernhardt
4 weeks ago

#2 @sabernhardt
4 weeks ago

  • Keywords has-patch added

#3 @SergeyBiryukov
4 weeks ago

  • Milestone changed from Awaiting Review to 7.0

#4 @SergeyBiryukov
4 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 61500:

Twenty Twenty-One: Consistently use theme version when enqueueing resources.

Follow-up to [49478], [49574].

Props sabernhardt.
Fixes #64526.

Note: See TracTickets for help on using tickets.