Sorry if this question is a bit to trivial, but I’m writing a theme that depends on a plugin to be installed. It’s a multilingual theme, so I absolutely need the user to have Polylang installed. I thought about just copying the plugin files into my theme, but that would mean my theme users won’t get Polylang updates.
So I hope you agree the best solution is to force the user to install polylang. Now, I would like to know what is the best way to let the user know he needs to install polylang? Is it possible to install a plugin automatically? What should happen if the user uninstalls polylang afterwars, just break the theme, or fall back to twentyeleven theme?
I would really love to hear some other people’s ideas on this.
sample code that you can addopt and chage… to check is plugin installed.
// addition check on init hook.
You actually can install plugin ( do silent download / unziping / actiavation) but its SO unacepted that you can’t imaging. You basicly breaking privacy of person who use your theme.
Codex:
is_plugin_active()