Newbie Question: How do I use the Bedrock Autoloader plugin

Maybe I am just dense or missing something obvious, but how do I use the autoloader plugin that is included in the bedrock framework. I am guessing that it requires a function call in the theme functions.php file but I couldn’t find any documentation on it. I’m sure it is something really obvious that I am just missing.

Thanks

1 Like

No functions to call you just need to place the plugin in the mu-plugins folder instead of theplugins folder.

You can do this by setting the package type to wordpress-muplugin in composer or by changing the custom installer paths:

"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"]
},

So in this example, Soil would be installed to mu-plugins/soil and autoloaded.

3 Likes

Ah, got it. Thanks for the clarification.

So, here is a NewbieQuestion^2…
Whats the advantage of autoloading the plugins with this Bedrock Autoloader?

Thanks!

It enables must-use plugins to be installed via composer and it enables you to declare standard plugins as must-use (meaning that they don’t need to be activated manually and cannot be deactivated from the dashboard).

4 Likes

This topic was automatically closed after 12 hours. New replies are no longer allowed.