Closed joshbetz closed 6 years ago
The trick is bootstrapping. WP core will include files in mu-plugins automatically, but there isn't a way for us to tell WP to include files from another folder.
Probably the only way to do it is to have clients include a 000-vip-init.php file in their own mu-plugins in every repo that bootstraps the Go plugins.
We could hijack wp_get_mu_plugins()
to load a file which itself loads our mu-plugins and the clients' mu-plugins by manipulating WPMU_PLUGIN_DIR
.
https://github.com/WordPress/WordPress/blob/703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885/wp-settings.php#L210-L213 https://github.com/WordPress/WordPress/blob/703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885/wp-includes/load.php#L525-L539
This gets very much in the realm of vipd.
Possible simpler option:
client-mu-plugins
folder (or something similar to vip-skeleton
).vipd
to make sure that folder ^^ gets included in containers.zzz-client-mu-plugins.php
that just loads files from client-mu-plugins the same way
wp_get_mu_plugins` does.The trade-off is that client mu-plugins load later (although, still before muplugins_loaded
) but I think that's okay.
We could probably even call it mu-plugins
in the vip-skeleton repo and map it as client-mu-plugins in the container, although that may be too confusing.
vip-mu-plugins
or something less confusing.muplugins_loaded
https://github.com/WordPress/WordPress/blob/703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885/wp-settings.php#L210-L223
Can we do this without breaking the
muplugins_loaded
hook? How early isadd_action
available? Can we add a hook before mu-plugins are loaded and include them there?