Skip to content

Instantly share code, notes, and snippets.

@jeherve
Forked from georgestephanis/gplus-authorship-tweaks.php
Last active December 23, 2015 15:08
Show Gist options
  • Save jeherve/6653059 to your computer and use it in GitHub Desktop.
Save jeherve/6653059 to your computer and use it in GitHub Desktop.
[Jetpack] Do not automatically activate the Widget Visibility module
<?php
// To disable the auto-activation of Jetpack's Widget Visibility module:
add_filter( 'jetpack_get_default_modules', 'disable_jetpack_widget_visibility_autoactivate' );
function disable_jetpack_widget_visibility_autoactivate( $modules ) {
return array_diff( $modules, array( 'widget-visibility' ) );
}
// Or, to disable the functionality in your own plugin if the user activates it in Jetpack:
if ( ! class_exists( 'Jetpack' ) || ! Jetpack::is_module_active( 'widget-visibility' ) ) {
// It's not there, do as you like!
}
// If you'd like to join the Jetpack Beta Group, drop us a line @jetpack on Twitter!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment