MerlinWP icon indicating copy to clipboard operation
MerlinWP copied to clipboard

Activate plugin base on the demo

Open dylan-ngo11 opened this issue 7 years ago • 7 comments

Hi! I've multiple demos with the different recommended plugin. Do MerlinWP support this feature? If don't, how can I custom it? Thank you!

dylan-ngo11 avatar Oct 25 '18 04:10 dylan-ngo11

Hi there,

You can add more demo data arguments via the array, like here in the doc.

richtabor avatar Oct 25 '18 10:10 richtabor

Hi @richtabor Thank for your response but I think you didn't understand my question. For example, I have Demo 1 and Demo 2

Demo 1 with required plugin:

  • Woocommerce
  • Yoast seo

Demo 2 with required plugin

  • EDD
  • WP Rocket

So How can I define different plugin list to each Demo?

dylan-ngo11 avatar Oct 26 '18 01:10 dylan-ngo11

I don't think this is possible in the current setup because the step where you choose which demo to import happens AFTER the step where the plugins are installed, so it has no way of knowing.. , so IMHO the two steps will have to switch places which in itself will create other problems related to importing plugin specific content or configs where the plugin has not yet been installed (ie. Revolution Slider). One thing you could do is disable unnecessary plugins programmatically in the step where the demo is being imported, you should be able to do that.

aurora-hq avatar Oct 26 '18 15:10 aurora-hq

I think in your tgmpa_register hook to register your plugins you could do a check for the current active theme, and only register the ones you want based on which theme is active.

JiveDig avatar Oct 29 '18 15:10 JiveDig

@JiveDig, I'll let @duongancol confirm that, but I don't think he's talking about different themes, it's the same theme with multiple demos.

aurora-hq avatar Oct 29 '18 16:10 aurora-hq

If it's different themes, then the tgmpa_register hook would be registering different plugins to begin with. Maybe I'm just not understanding at all.

JiveDig avatar Oct 29 '18 17:10 JiveDig

@aurora-hq understands correctly my idea. It's one theme with different demos. I changed the plugin activation step with Demo selector step, now the user will choose the demo install before choosing the plugin list. I'm finding a way to custom the plugin list base on the demo selected and not success yet.

dylan-ngo11 avatar Nov 06 '18 07:11 dylan-ngo11