Advanced Customizations

Below you’ll find advanced customizations that are outside the scope of SiteOrigin Premium settings. These customizations can either be added to a child theme functions.php file or by using the plugin Code Snippets. If you’d like to add a function using Code Snippets:

  1. Install and active the plugin, Code Snippets.
  2. Go to SnippetsImport.
  3. Import the function provided in the form of a JSON file. A JSON file is provided with each function below. Right click and Save As to download.

Enable the LiveMesh Grid Widget in the SiteOrigin Tabs Widget

By default, the LiveMesh Grid widget doesn’t function correctly in the SiteOrigin Tabs widget Layout Builder. The following customization fixes this problem.

Code Snippets Import File
SiteOrigin Tabs Livemesh Grid.

Enable the SiteOrigin Post Loop Widget: Masonry Layout in the SiteOrigin Tabs Widget

If you’re using SiteOrigin Corp and have inserted a SiteOrigin Post Loop widget with Masonry layout into the SiteOrigin Tabs widget, there will be no problem if the tab used is the initially selected tab (the tab that’s open on page load). However, if you’d like to use the Masonry layout in a tab that isn’t open by default, the following snippet will be required.

Code Snippets Import File
Enable the Corp Masonry Layout in the Tabs Widget. Once downloaded, un-zip the file before importing into Code Snippets plugin.

Disable Automatic Plugin Update Checks

Using the below filter will prevent SiteOrigin Premium from checking for updates unless you’re viewing DashboardUpdates or the plugins ‘Update Available’ page.

add_filter( 'siteorigin_premium_background_update_check_enabled', '__return_false' );

Code Snippets Import File
Disable SiteOrigin Premium Automatic Plugin Update Checks.

Disable Plugin Recommendations

Plugin recommendations can be dismissed using the dismiss link in the notification bar. If for any reason this isn’t working, perhaps due to a plugin conflict, recommendations can be disabled using the following filter. This filter should be added via the Code Snippets plugin or from within a custom plugin to work.

add_filter( 'siteorigin_add_installer', '__return_false' );

Code Snippets Import File
Disable SiteOrigin Premium Plugin Recommendations.

Bulk Activate All SiteOrigin Premium Addons

The following function can be used to bulk enable all SiteOrigin Premium addons.

function so_enable_all_addons() {
	update_option(
		'siteorigin_premium_active',
		array(
			plugin/accordion' => true,
			plugin/animations' => true,
			plugin/carousel' => true,
			plugin/contact-form-fields' => true,
			plugin/cpt-builder' => true,
			plugin/cta' => true,
			plugin/hero' => true,
			plugin/image-overlay' => true,
			plugin/lightbox' => true,
			plugin/link-overlay' => true,
			plugin/map-styles' => true,
			plugin/mirror-widgets' => true,
			plugin/parallax-sliders' => true,
			plugin/social-widgets' => true,
			plugin/tabs' => true,
			plugin/testimonial' => true,
			plugin/toggle-visibility' => true,
			plugin/tooltip' => true,
			plugin/web-font-selector' => true,
			plugin/woocommerce-templates' => true,
		)
	);

	if ( class_exists( 'SiteOrigin_Settings' ) ) {
		$settings = SiteOrigin_Settings::single();
		$settings->set( 'blog_ajax_comments', true );
	}
}
add_action( 'init', 'so_enable_all_addons' );

Code Snippets Import File
Activate All SO Premium Addons.

Custom Post Type Builder: Adjust the register_post_type arguments

The siteorigin_premium_cptb_post_type_register filter allows adjustment of the `register_post_type` arguments. For example, if you wanted to completely hide from the frontend the CPTB post type called test you could use the following PHP to do that:

add_filter( 'siteorigin_premium_cptb_post_type_register', function( $args, $post_type ) {
	if ( $post_type == 'test' ) {
		$args['public'] = false;
		$args['has_archive'] = false;
		$args['publicaly_queryable'] = false;
		$args['query_var'] = false;
	}

	return $args;
}, 10, 2 );

Enable SSL Verification

SSL verification can be enabled if the license activation debug output mentions stream_socket_client(): SSL operation failed with code 1.. The below filter allows servers that require validation for secure connections to function normally.

add_filter( 'siteorigin_premium_sslverify', '__return_true' );

Code Snippets Import File
SiteOrigin Premium SSL Verify.

Retrieve the Most Recent License Error

The below URL will store the latest license error to assist with license debugging if necessary. To view the notice, navigate to the below URL. Replace https://site.url/ with your website URL.

https://site.url/wp-admin/admin.php?page=siteorigin-premium-license&sow-debug-license=true

A white page will load with a debug output. Copy the debug information and send it to [email protected] for assistance.

Debug SiteOrigin Premium License Activation Faliure

In the event of an unexpected license activation failure, the following URL can be visited:

https://site.url/wp-admin/admin.php?page=siteorigin-premium-license&action=save&sow-debug=true

Replace https://site.url/ with your website URL.

Clear the license key field and click the Save button. Next, insert your license key and click Save again. A white page will load with a debug output. Copy the debug information and send it to [email protected] for assistance.