Skip to content

Conversation

@sabernhardt
Copy link
Contributor

Fixes #222

Maintains the original post handle for translations, but changes the src to the plugin's file.

@sabernhardt
Copy link
Contributor Author

There is plenty of room for improvement :)

For example, I was lazy and did not create a name for the function.

@azaozz
Copy link
Contributor

azaozz commented Nov 28, 2024

Thanks for the patch!

Moved the fix to its own function (so plugins are able to remove the filter), and prepared for release. Please have a look if it works as expected after the changes.

@jonathanbossenger
Copy link

I came here via this support thread for the Classic Editor plugin, and I can confirm that this fixes that issue as well.

@sabernhardt
Copy link
Contributor Author

The revised code seems good, and I like the type check before using strpos.

  • With this update, the script comes from the plugin, with translations. When clicking "Enregistrer le brouillon", the button text remains "Enregistrer le brouillon".
  • Clicking category 1 does not affect 10+ or 100+, and clicking 2 does not affect 20+ or 200+ (same behavior as current/previous version).
  • When I activated this and the Hotfix plugin, Hotfix 1.3 overrode Classic Editor, without translations.
  • When I activated this at classic-editor and the current/previous version at classic-editor166, the script came from the newer plugin (with translations).

@azaozz
Copy link
Contributor

azaozz commented Dec 2, 2024

Thanks @jonathanbossenger and @sabernhardt for confirming.

I like the type check before using strpos.

Yea, technically $src can be false (denotes a group of scripts).

@azaozz azaozz merged commit 621be43 into WordPress:trunk Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WordPress 6.7.1 script replacement does not have JS translations

3 participants