Project: Part 1, Part 2, Part 3
This WordPress MU-Plugin loads MU-Plugins from subdirectories. WordPress only looks for PHP files right inside the MU-Plugins directory, and not for files in subdirectories (unlike for normal plugins).
After installing the package, copy the mu-plugin-autoloader.php file inside of the MU-Plugins directory (/mu-plugins
), to load WordPress MU-Plugins automatically.
This MU-Plugin is a modified version based on the richardtape/subdir-loader.php Github Gist.
composer require dark-kitt/wordpress-mu-plugin-autoloader
If you have a specific path to your MU-Plugin directory, please add the following lines to your composer.json file.
"extra": {
"installer-paths": {
"path/to/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
]
},
"wordpress-install-dir": "path/to/wordpress"
},
Note, for a specific commit of your VCS Repo "require": { "vendor/repo_name": "dev-main#eec8698" }
(branch#commit).
common composer cmds
composer install
composer update
# package control
composer require verdor/package
composer remove verdor/package
composer clear-cache
composer show -i # installed packages