-
-
Save ramiabraham/9264626 to your computer and use it in GitHub Desktop.
Disable Jetpack modules, by Rob Neu: http://wpbacon.com/tutorials/disable-jetpack-modules/
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 | |
/** | |
* Disable all non-whitelisted jetpack modules. | |
* | |
* This will allow all of the currently available Jetpack modules to work | |
* normally. If there's a module you'd like to disable, simply comment it out | |
* or remove it from the whitelist and it will no longer load. | |
* | |
* @author FAT Media, LLC | |
* @link http://wpbacon.com/tutorials/disable-jetpack-modules/ | |
*/ | |
add_filter( 'jetpack_get_available_modules', 'prefix_kill_all_the_jetpacks' ); | |
function prefix_kill_all_the_jetpacks( $modules ) { | |
// A list of Jetpack modules which are allowed to activate. | |
$whitelist = array( | |
'after-the-deadline', | |
'carousel', | |
'comments', | |
'contact-form', | |
'custom-css', | |
'enhanced-distribution', | |
'gplus-authorship', | |
'gravatar-hovercards', | |
'infinite-scroll', | |
'json-api', | |
'latex', | |
'likes', | |
'minileven', | |
'mobile-push', | |
'monitor', | |
'notes', | |
'omnisearch', | |
'photon', | |
'post-by-email', | |
'publicize', | |
'sharedaddy', | |
'shortcodes', | |
'shortlinks', | |
'sso', | |
'stats', | |
'subscriptions', | |
'tiled-gallery', | |
'vaultpress', | |
'videopress', | |
'widget-visibility', | |
'widgets', | |
); | |
// Deactivate all non-whitelisted modules. | |
$modules = array_intersect_key( $modules, array_flip( $whitelist ) ); | |
return $modules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment