Last active
March 31, 2016 02:52
-
-
Save markjaquith/5671688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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