Repository navigation
Use default version for hash generation if not set - #33
Merged
Merged
Conversation
Member
|
Good catch! I think the implementation here needs to be slightly more complex. The logic in core is that if the value is |
Refactor version handling logic for asset versioning.
Member
Author
|
@rmccue Thanks for your feedback - yes good spot. Updated to ensure logic is exactly the same as core (Both |
rmccue
requested changes
Feb 24, 2026
rmccue
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been running into a bug: for a block theme, the core block styles fail to load after updating WordPress as the integrity hash check fails. This is despite the version no appended to the src changing. Clearing CDN cache doesn't solve the problem.
This affects core block styles like:
This is because - for core blocks, no version is provided at the point the styles are registered. The version in block metadata is not used and it is hardcoded to false. Note that assets without versions do default to the current WordPress version number however this is only done at the point the tag is output.
I think the best fix for this is, to use the the default version when calculating the cache key if no version is explicitly provided.