Load order of plugins
Depending on the method used to activate a plugin, it will hook into the WordPress load order at different points. Plugins will load based on the following hooks—from earliest to latest in the WordPress load process—when activated with the described methods:
- On the
muplugins_loaded
hook: Plugins that are activated viawpcom_vip_load_plugin( 'plugin-name' )
fromclient-mu-plugins
. This method of code-activating plugins is recommended. - Before the
after_setup_theme
hook: Plugins that are activated viawpcom_vip_load_plugin( 'plugin-name' )
in a theme’sfunctions.php
. This method is supported, but code activation fromclient-mu-plugins
is preferred. - Before the
plugins_loaded
hook: Plugins that are manually activated from the WordPress Admin dashboard Plugins screen. This method is supported, but activating plugins through code is recommended.
Sometimes plugins have dependencies on running before specific hooks. To hook on very early actions or filters, load the plugin’s code from the /client-mu-plugins
directory.
Last updated: August 08, 2024