Open schlessera opened 7 years ago
@schlessera This feature is already implemented. Please close this issue.
@pmbaldha I don't think that's the case: https://d.pr/i/He4Pec
I might pick this one up.
@schlessera It appears that WP itself doesn't list mu-plugins that are nested within other directories.
From the function that lists mu-plugin (https://developer.wordpress.org/reference/functions/get_mu_plugins/):
WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).
I can still include nested mu-plugin files, but that wouldn't be mirroring what WP itself is doing. Unless I'm understanding the ticket wrong?
Can you please clarify? Thanks!
As per WordPress documentation:
WordPress only looks for PHP files right inside the mu-plugins directory, and (unlike for normal plugins) not for files in subdirectories. You may want to create a proxy PHP loader file inside the mu-plugins directory
.
So if you use a (auto)loader the mu-plugins in the subdirectory are loaded, but not listed by wp plugin list
.
A lot of more complex sites make use of subfolders in the
muplugins
folder, just like with regular plugins.They then use something like the Bedrock Autoloader or the MULoader in WPStarter.
Although these plugins are then active like normal plugins and properly shown in the WP admin backend, WP-CLI does not display them with
plugin list
.To correctly mirror WP behaviour, these should be shown as well if they are active.