Remove flatten_version utility and related logic#470
Merged
enricobattocchi merged 1 commit intorelease/4.6from Mar 2, 2026
Merged
Remove flatten_version utility and related logic#470enricobattocchi merged 1 commit intorelease/4.6from
flatten_version utility and related logic#470enricobattocchi merged 1 commit intorelease/4.6from
Conversation
…to use static filenames
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.
Context
The Block editor button translations were not working after bumping the version to 4.6-RC1. The issue was caused by how WordPress resolves script translation files from WP.org.
When
wp_set_script_translations()is called, WordPress computes an MD5 hash from the relative file path of the registered script to look up the corresponding JSON translation file on WP.org. Previously, script filenames included a flattened version number (e.g.,duplicate-post-edit-450.jsfor v4.5), but the flattening logic failed with pre-release suffixes, producing incorrect filenames likeduplicate-post-edit-46-RC1.js. This caused the translation file hash to not match any existing translations on WP.org.Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Relevant test scenarios
Test instructions for QA when the code is in the RC
Plus the translations for the buttons in the Block editor should be working.
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Documentation
Quality assurance
Innovation
innovationlabel and noted the work hours.Fixes #