-
-
Save jentanbernardus/fb4a421b0b909f1cb880dbf145fa7f61 to your computer and use it in GitHub Desktop.
This file contains hidden or 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