Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on just-in-time translation loading #738

Open
wants to merge 1 commit into
base: v7.0
Choose a base branch
from

Conversation

swissspidy
Copy link

The plugin was loading translations too early on plugins_loaded. Plugins should wait until init to ensure the current user has been set up, so that the current user's locale can be respected.

That said, why manually load translations when WordPress can do it for you :-)

Removes the manual load_plugin_textdomain() call to rely on WordPress to load translations at the right time, which was added in WordPress 4.6.

@szepeviktor
Copy link
Contributor

was added in WordPress 4.6

Requires at least: 4.9

@swissspidy
Copy link
Author

Yep 👍

I noticed they changed this since I opened my previous PR (#657) which I accidentally deleted

@szepeviktor
Copy link
Contributor

if (version_compare($GLOBALS['wp_version'], '4.9', '<')) {

@hi-hai
Copy link
Collaborator

hi-hai commented Sep 5, 2024

Thanks. Will review and consider to use this as we escalated the WP min ver from v4.0 to v4.9.

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.

3 participants