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

Translation loading for the hello-elementor domain was triggered too early. #429

Open
pingram3541 opened this issue Dec 13, 2024 · 3 comments

Comments

@pingram3541
Copy link

I have scoured the theme files and cannot find what is causing this. I cannot find any mention of textdomain let alone 'domain' yet when I need to debug, my log file is full of this error.

[12-Dec-2024 23:52:59 UTC] PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hello-elementor domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /../../../public_html/wp-includes/functions.php on line 6114

@pingram3541
Copy link
Author

It's caused by __() functions executing prior to init.

@rami-elementor
Copy link
Member

@pingram3541 See my answer in #423

@pingram3541
Copy link
Author

Thanks @rami-elementor, interestingly, when this theme files are scanned, the only instance of "textdomain" can be found in the change log text file, yet the error persists and the domain in the error is 'hello-elementor'.

Did you happen to see the Make link above your answer in #423? It suggests that __() functions triggered before init will also result in this error.

Your plugin might be _doing_it_wrong() if you for example directly call get_plugin_data() (which attempts to load translations by default) or __() without waiting for the init hook.

I have commented out the code in WordPress core that causes this problem, yeah I know cardinal sin but they provided no way to hook or filter it out and the constant chatter in my debug log (which is needed to flush out another problem) was just too much to bare. Thanks for your help with this.

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

No branches or pull requests

2 participants