Skip to content

Instantly share code, notes, and snippets.

@markjaquith
Last active March 31, 2016 02:52
Show Gist options
  • Save markjaquith/5671688 to your computer and use it in GitHub Desktop.
Save markjaquith/5671688 to your computer and use it in GitHub Desktop.
<?php
class CWS_Jetpack_Modules {
function __construct() {
add_filter( 'option_jetpack_active_modules', array( $this, 'active_modules' ) );
}
function active_modules( $modules ) {
$allowed_modules = array(
'enhanced-distribution',
'mobile-push',
'publicize',
'stats',
);
$forced_active_modules = array(
'enhanced-distribution',
'mobile-push',
'publicize',
'stats',
);
$modules = array_intersect( (array) $modules, $allowed_modules );
$modules = array_merge( $modules, $forced_active_modules );
$modules = array_unique( $modules );
return $modules;
}
}
new CWS_Jetpack_Modules;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment