Hi There,
First of congratulations for creating great plugin. I’m loving it.
I am a theme developer and includes your page builder in my themes. I used to build widgets WordPress way and include it as a separate plugin which client can activate while activating the theme. Now as you have come up with “Widgets Bundle” plugin, it’s lot easier to create widgets for pagebuilder. Now I’m converting all widgets using “Widget Bundle” as a framework and providing all widgets inside the theme only so they don’t have to activate them as a plugin.
Just one issue doing so, I don’t want clients to go to plugins > “Site Origin Widgets” to activate widgets, I want my theme widgets to be active when client activates the theme and other required plugins including “Site Origin Page Builder”.
I badly need a way to activate the widgets automatically rather going to page and activating a widget. Can you please show me how can I achieve that?
Thanks for great work.
Thanks,
Vrushank
Hi Vrushank
Awesome to hear you’re building on top of the WB framework! Always makes me happy to hear that it’s making developer’s lives a little easier. There are 2 options you have here. The first is to use the widget activation function. You can use this from anywhere. It’s best suited to a function that runs after your theme/plugin activation.
The main problem there is that themes don’t have an activation function like plugins do.
Another option is to filter the siteorigin_widgets_active_widgets value. This will force the widget to always be active, regardless of whether the user tries to deactivate it in Plugins > SiteOrigin Widgets.
Hopefully that points you in the right direction :)
Greg, You are simply awesome.
Does the job for me.
Thanks a lot for helping me out!!
It’s a pleasure :) Always happy to help out.