Skip to content

Latest commit

 

History

History
28 lines (25 loc) · 1.2 KB

mu-plugins-autoloader.md

File metadata and controls

28 lines (25 loc) · 1.2 KB
ID post_title author post_date post_excerpt layout permalink published docs_project publish_to_discourse
6143
mu-plugins Autoloader
Ben Word
2015-09-03 10:18:35 -0700
doc
true
a:1:{i:0;s:2:"18";}
a:1:{i:0;s:1:"0";}

Bedrock includes an autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included after all mu-plugins and standard plugins have been loaded. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded. To remove this functionality, just delete web/app/mu-plugins/bedrock-autoloader.php.

This enables the use of mu-plugins through Composer if their package type is wordpress-muplugin. You can also override a plugin's type like the following example:

"installer-paths": {
  "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin", "roots/soil"],
  "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
  "web/app/themes/{$name}/": ["type:wordpress-theme"]
},

Soil is a package with its type set to wordpress-plugin. Since it implements composer/installers we can override its type.