load_plugin_textdomain loaded too early
-
I run ninja forms in a multisite, but not with network activate.
If a new site is created, I activate the plugin by code with
activate_plugin( 'ninja-forms/ninja-forms.php' );If I then visit the dashboard of the newly created site, I see an error popup in the debug.log:
“Function _load_textdomain_just_in_time was called incorrectly“.To me this makes sense, because afaik the function load_plugin_textdomain, should be added to the action ‘init’. Ninja forms has it hooked to plugins_loaded.
This looks to me to be the wrong hook, see the official wordpress documentation
on https://developer.wordpress.org/reference/functions/load_plugin_textdomain/A lot of plugins I checked use init as hook. Some of the plugins I use on the same site, use init as well, and they have never given me this error.
I am not saying with 100% certainty that this is the fix, but it does look like it, because I changed it to init and no more errors showed. When I changed it back no more errors showed either, so I think it has something to do with the moment on initialization (not sure).
You must be logged in to reply to this topic.