Created
December 9, 2013 13:26
-
-
Save jeherve/7872205 to your computer and use it in GitHub Desktop.
[Jetpack] Force deactivate all modules but stats
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 | |
// Force deactivate all Jetpack modules, except for stats | |
function jeherve_force_deactivate_everything_but_stats() { | |
if ( class_exists( 'Jetpack_Options' ) ) | |
Jetpack_Options::update_option( 'active_modules', array_unique( array( 'stats' ) ) ); | |
} | |
add_action( 'init', 'jeherve_force_deactivate_everything_but_stats' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment