MU plugins subdirectory loader
This WordPress MU-Plugin loads MU-Plugins from subdirectories.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/kitt-digital/wordpress-mu-plugin-autoloader/archive/refs/heads/main.zipProject: Part 1, Part 2, Part 3
Introduction
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.
Requirements
Installation
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