Failed to invoke other hook from the init hook

The locale hook happens long before init. To see when which hook, variable, constant, function, class or file is available install my plugin T5 WP Load Order.

You get a looong file with a very detailed log. Search for Hook: locale, then for Hook: init. You will see that you need plugins_loaded as parent action if you want to chain hooks.

Is it a good practice? It depends. If you need the second callback only when the first was running successful, then yes. If both callbacks should run independently of each other, then no.
Chaining should reflect the logic of your program.

Leave a Comment