vinkla / wordplate

A boilerplate for WordPress, built with Composer and designed with sensible defaults.
2.11k stars 155 forks source link

Integrate TGM Plugin Activation? #56

Closed puredazzle closed 9 years ago

puredazzle commented 9 years ago

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?

vinkla commented 9 years ago

Is it possible to active plugins specified in our composer.json by default in our boilerplate theme?

puredazzle commented 9 years ago

@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.

vinkla commented 9 years ago

Personally I would prefer if the plugins were activated when activating the theme. Is there a way to do that?

puredazzle commented 9 years ago

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.

vinkla commented 9 years ago

Great! I've assigned this to you. I hope thats okay with you?

vinkla commented 9 years ago

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?

puredazzle commented 9 years ago

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 ?

puredazzle commented 9 years ago

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?

vinkla commented 9 years ago

We could specify which plugins to load in the config files. Sounds good. Could you make a pull request?

vinkla commented 9 years ago

What about this article? Change the default theme for sites without a plugin.

puredazzle commented 9 years ago

@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.

vinkla commented 9 years ago

Isn't possible to just add this to the config file?