Opened 3 years ago
Closed 3 years ago
#53502 closed defect (bug) (fixed)
Twenty Twenty-One: Remove use of `filemtime()`
Reported by: | desrosj | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Bundled Theme | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
In Twenty Twenty-One, there are two instances of filemtime()
to create a version number for a CSS or JS asset.
This should be removed in favor of wp_get_theme()->get( 'Version' )
.
Change History (11)
#2
@
3 years ago
Since there will be a new version of the theme released with WordPress 5.8, would it make sense to include this too, rather than wait for 5.8.1?
This ticket was mentioned in Slack in #core by desrosj. View the logs.
3 years ago
#4
@
3 years ago
No objection here! Only put it into 5.8.1 to try and allow a newer contributor some time to grab it!
I just shared the ticket in #core on Slack. Let's see if anyone is able to create a patch!
#5
follow-up:
↓ 8
@
3 years ago
Out of curiosity, is there a reason to not use filemtime
, or just that it's stable now and should use wp_get_theme()->get( 'Version' )
?
This ticket was mentioned in PR #1432 on WordPress/wordpress-develop by peterwilsoncc.
3 years ago
#6
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/53502
#7
@
3 years ago
I've set up a pull request for this change. https://github.com/WordPress/wordpress-develop/pull/1432
#8
in reply to:
↑ 5
@
3 years ago
Replying to ryelle:
Out of curiosity, is there a reason to not use
filemtime
, or just that it's stable now and should usewp_get_theme()->get( 'Version' )
?
In certain set ups or using some deployment techniques the file's modified time can change more frequently than the file is modified so browser and proxy caches end up getting broken more often than needed.
I think that was supposed to be temporary...