Home>Support>Can I include SiteOrigin Widgets Bundle in my theme ?

Can I include SiteOrigin Widgets Bundle in my theme ?

Hi SiteOrigin team :)

First of all, I have to say thank you to you guys for the useful plugins. I’m a WordPress theme developer and build my theme on top of SiteOrigin Widgets Bundle. Now I want to upload my theme to WordPress.org and they have some requirements which leads to my question. It’s likely that I shouldn’t ask here but there is someone is now spamming posts on WordPress.org theme development forum, so my post on WordPress.org may not be noticed. That’s why I also ask here — I apologize for my improper thread.

I include only core code of SiteOrigin Widgets Bundle as a “Widget Framework Fallback” in my theme and remove unnecessary files, folders and some action hooks(some of which are unnecessary when I include core code directly in my theme).

I read WordPress theme submission requirements carefully. It was written in the document that I can include frameworks but can’t include any plugins in my theme, however I can recommend ones which WordPress will then notify users to install the recommended plugins.

My question is Can I include SiteOrigin Widgets Bundle core code in my theme as a fallback in case my users haven’t yet installed SiteOrigin Widget Bundle on their website and then upload my theme to WordPress.org ?

I know that i can use TGM plugin Activation to recommend/require SiteOrigin Widget Bundle and separate my widgets code as a plugin, but I think it may not be a solution as my theme won’t run properly and my users won’t see “theme live preview” correctly if they haven’t yet installed SiteOrigin Widget Bundle.

Here is the code I am using to check whether my users have already installed SiteOrigin Widgets Bundle plugin or not.

function my_so_widgets_bundle () {
	if ( !class_exists('SiteOrigin_Widgets_Bundle') ) {
		require get_template_directory() . '/inc/so-widgets-bundle-fallback/so-widgets-bundle-fallback.php';
	}
	require get_template_directory() . '/inc/my-widgets/my-widgets.php';
}
add_action('after_setup_theme', 'my_so_widgets_bundle', 1);

Thanks in advance.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More