Closed puredazzle closed 9 years ago
Is it possible to active plugins specified in our composer.json
by default in our boilerplate theme?
@vinkla then the plugins get activated before you activate the theme. But I guess that is not a problem here since this is the only theme you are using.
Personally I would prefer if the plugins were activated when activating the theme. Is there a way to do that?
With the plugin mentioned above that is possible. We might have to look a the code and see how we can integrate it to our theme.
Great! I've assigned this to you. I hope thats okay with you?
We could also require the plugins we want to use in our theme like this.
function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../timber.php';
require dirname( __FILE__ ) . '/../vendor/AdvancedCustomFields/acf5-beta/acf/advanced-custom-fields-pro/acf.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Then we wouldn't need to add an extra plugin or other library. What do you think?
That sounds good. We should have an array in the config with the plugins the user wants to activate on init? Is muplugins_loaded
the right function to hook? This might be good also http://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme ?
Maybe we should force load the TGM-Plugin with the function you mentioned above on switch_theme and then use https://github.com/thomasgriffin/TGM-Plugin-Activation/blob/master/example.php?
We could specify which plugins to load in the config files. Sounds good. Could you make a pull request?
What about this article? Change the default theme for sites without a plugin.
@vinkla that is perfect for activating the theme per default. that should be added. this however requires some kind of function after the activation of the theme.
Isn't possible to just add this to the config file?
Require and activate plugins on theme activation. Maybe this plugin? http://tgmpluginactivation.com/
Are there any better ones or is it easy to integrate other way?