WordPress Composer multiple mu-plugins fix Blog

Normally WP Plugins have this structure:

plugins/plugin-name1/some.php

plugins/plugin-name2/some.php

plugins/plugin-name3/some.php

 

However MU-plugins should have this structure

mu-plugins/plugin-name1.php

mu-plugins/plugin-name2.php

mu-plugins/plugin-name3.php

This is an issue when using composer, as composer is only capable of using (sub) folders. When set to mainlevel folders, composer will delete its contents for each new plugin, resulting in only the last plugin ( in this example plugin-name3 ) "standing"..

To overcome this we have muplugins.sh which moves each sub php file to their parent directory and removes the (now empty) directory where the sub php file was residing.

 

muplugins.sh
https://gist.github.com/ramonfincken/4c2c29f4a5b209280cd436f8f827b9e5

composer.json
https://gist.github.com/ramonfincken/3085273439cffe0a1eb2fbed93b06ced

composer.json
https://gist.github.com/ramonfincken/ba65dce0e2b9d239b7a55026f8af1d0c


Suggestie? Vraag of opmerking? Laat het ons weten!

Plaats hier je bericht

Reacties (0)