Execute code before plugins are executed I'm looking for a way to execute some code before the whole system loads, more precisely right before plugins are loaded/executed.



Use case

I want to instanciate a custom object, that I need to interact with in my plugin, but I cannot declare it INSIDE my plugin. This object should actually be available in all plugins if needed.

Where should I put such code so it is reusable ?
Thanks a lot !
You could put that code in index.php, before the require_once line. That’s about as early in the request as you can get ;)