I’m creating a wordpress theme that I aim to sell at some point.
Now, I’ve discovered that some of the wordpress.org plugins would be great for things that I want to do. They already hold much of the functionality I aim to achieve, so I thought of using them directly (they are under GPL I suppose).
I would probably need to adjust stuff, but I was wondering. Is there any universal-like way to include wordpress plugins inside my theme and not in the separate plugins folder ?
That would be ideal, because I do not really want customers to have to copy to different folders. At first glance of the plugins, it seems not possible, but I suppose it never hurts to ask 🙂
Let me make a recommendation: do not bundle plugins with your theme!
On first glance, yes this is a very easy way to add default functionality with your theme, but there are a slew of reasons not to include the plugins this way:
There have been plenty of other people who’ve talked about this in the past.
The better way to do this would be to have your theme check for specific plugins and prompt the user for installation if they’re missing.
This class was built with your question and idea in mind. It solves that problem by allowing theme authors to include pre-packaged plugins or plugins from the repo with ease.
https://github.com/thomasgriffin/TGM-Plugin-Activation
I strongly believe that if you aim to sell at some point you should NOT include/use GPL plugins and only your own!!!
Now after that being said simply include the plugin’s main file you your theme’s functions.php and edit all path’s