mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
22 lines
455 B
Text
22 lines
455 B
Text
// Deactivate the Stats module.
|
|
add_filter(
|
|
'jetpack_active_modules',
|
|
function ( $modules ) {
|
|
$stats_index = array_search( 'stats', $modules, true );
|
|
if ( false !== $stats_index ) {
|
|
unset( $modules[ $stats_index ] );
|
|
}
|
|
return $modules;
|
|
},
|
|
11
|
|
);
|
|
|
|
// Remove the Stats module from the list of available modules.
|
|
add_filter(
|
|
'jetpack_get_available_modules',
|
|
function ( $modules ) {
|
|
unset( $modules['stats'] );
|
|
return $modules;
|
|
},
|
|
11
|
|
);
|