Skip to content

Instantly share code, notes, and snippets.

@kraftbj
Created October 12, 2015 22:16
Show Gist options
  • Save kraftbj/6814311228aa5ce9b362 to your computer and use it in GitHub Desktop.
Save kraftbj/6814311228aa5ce9b362 to your computer and use it in GitHub Desktop.
Auto-activating Jetpack modules
<?php
/*
* Plugin Name: DS.LC Force Jetpack Modules
* Plugin URI: http://jetpack.me
* Description: Custom plugin to enable exact set of Jetpack Modules
* Author: Brandon Kraft
* Version: 1.0.0
* Author URI: https://kraft.im/
* License: GPL2+
*/
function dslc_auto_activate_sso( $modules ) {
if ( ! in_array( 'sso', $modules ) ) {
$modules[] = 'sso';
}
return $modules;
}
add_filter( 'jetpack_get_default_modules', 'dslc_auto_activate_sso' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment