Plugins load order
Depending on how a plugin is loaded, it will hook into the WordPress load order at different points (from latest to earliest):
- Manually activated from the
wp-admin
Plugins screen (supported, but code activation is preferred): before theplugins_loaded
hook wpcom_vip_load_plugin( 'plugin-name' )
in a theme’sfunctions.php
(supported, but code activation fromclient-mu-plugins
is preferred): before theafter_setup_theme
hookwpcom_vip_load_plugin( 'plugin-name' )
fromclient-mu-plugins
(recommended): on themuplugins_loaded
hook
Sometimes plugins may have dependencies on running before specific hooks. In order to hook on very early actions or filters, the plugin’s code will need to load from /client-mu-plugins
directory.