Closed mattstratton closed 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.
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"}],
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.
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
?
Correct! Some packages on WPackagist might have it too although I doubt it (it would be rare anyway).
@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!
@fagiani if you have any suggestions/improvements, you can propose them on our docs repo: https://github.com/roots/docs
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?