jetpack_get_available_modules

Filters the array of modules available to be activated.

Description

apply_filters( 'jetpack_get_available_modules', (array) $modules, (string) $min_version, (string) $max_version ); 

Parameters (3)

0. $modules (array)
Array of available modules.
1. $min_version (string)
Minimum version number required to use modules.
2. $max_version (string)
Maximum version number required to use modules.

Usage

To run the hook, copy the example below.
  1. $modules = apply_filters( 'jetpack_get_available_modules', $modules, $min_version, $max_version ); 
  2.  
  3. if ( !empty( $modules ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack_get_available_modules callback 
  2. function filter_jetpack_get_available_modules( $modules, $min_version, $max_version ) { 
  3. // make filter magic happen here... 
  4. return $modules
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_get_available_modules', 'filter_jetpack_get_available_modules', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_get_available_modules', 'filter_jetpack_get_available_modules', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/class.jetpack.php  
  1. $mods = apply_filters( 'jetpack_get_available_modules', $modules, $min_version, $max_version );