roots / bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure
https://roots.io/bedrock/
MIT License
6.19k stars 1.17k forks source link

Example of MU plugins? #132

Closed mattstratton closed 9 years ago

mattstratton commented 9 years ago

The README says:

An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded

This is not clear. An example would be great. Would it look something like this?

    "arresteddevops/ado-plugin*": "1.2.1",
    "wpackagist-plugin/CryptX": "~3.2.8",
swalkinshaw commented 9 years ago

That sentence is referring to the WP Admin plugin page. The README already contains an example of overriding a specific plugin in your composer.json to make it an mu-plugin.

mattstratton commented 9 years ago

OK, so that was what I was not totally sure about. The example doesn't show multiple plugins either (this seems to be a pretty common use case, as if a theme depends upon a plugin, I want to be sure it is activated and cannot be messed with).

Is this line duplicated for each plugin "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin", "roots/soil"],

or is it set up as an array?

"web/app/mu-plugins/{$name}/": [{"type:wordpress-muplugin", "roots/soil"},{"type:wordpress-muplugin", "mysite/plugin"}],
swalkinshaw commented 9 years ago

You would do:

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

And this is only necessary if mysite/plugin has its package type set to wordpress-plugin. If it's wordpress-muplugin then you don't have to do anything.

mattstratton commented 9 years ago

So items that come from wpackagist would need this, but any of my own custom plugins that I have created a repository for would not, as long as I set their type to wordpress-muplugin?

swalkinshaw commented 9 years ago

Correct! Some packages on WPackagist might have it too although I doubt it (it would be rare anyway).

fagiani commented 6 years ago

@swalkinshaw it took me a couple of hours to understand what you explain in this very comment.

I had some issues with a specific plugin because it's name was different from it's own composer.json specs. The require would work but plugin would appear on the regular plugins. After noticing you say ...has its package type set to... I've headed to the project's composer spec and noticed both it's type and it's real name.

I'd really appreciate if this page could be a bit more detailed or elaborated about mu-plugins with regards to the package's composer options.

Keep rocking!

swalkinshaw commented 6 years ago

@fagiani if you have any suggestions/improvements, you can propose them on our docs repo: https://github.com/roots/docs