Filters the array of modules available to be activated.
Parameters
- $modules
array
Array of available modules.
- $min_version
string
Minimum version number required to use modules.
- $max_version
string
Maximum version number required to use modules.
- $requires_connection
(bool | null)
Value of the Requires Connection filter.
- $requires_user_connection
(bool | null)
Value of the Requires User Connection filter.
Changelog
- Introduced in Jetpack 2.4.0
How to use this hook
Notes
That filter allows you to change the list of modules that can be activated and deactivated by admins. For example, if you didn’t want anyone to be able to activate the Stats module on your site, you could do this:function jeherve_kill_stats( $modules, $min_version, $max_version ) { unset( $modules['stats'] ); return $modules; } add_filter( 'jetpack_get_available_modules', 'jeherve_kill_stats', 20, 3 );