jetpack_get_module

Filter the returned data about a module.

Description

apply_filters( 'jetpack_get_module', (array) $mod, (string) $module, (string) $file ); 

This filter allows overriding any info about Jetpack modules. It is dangerous, so please be careful.

Parameters (3)

0. $mod (array)
The details of the requested module.
1. $module (string)
The slug of the module, e.g. sharedaddy
2. $file (string)
The path to the module source file.

Usage

To run the hook, copy the example below.
  1. $mod = apply_filters( 'jetpack_get_module', $mod, $module, $file ); 
  2.  
  3. if ( !empty( $mod ) ) { 
  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_module callback 
  2. function filter_jetpack_get_module( $mod, $module, $file ) { 
  3. // make filter magic happen here... 
  4. return $mod
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_get_module', 'filter_jetpack_get_module', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_get_module', 'filter_jetpack_get_module', 10, 3 ); 

Defined (1)

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

/class.jetpack.php  
  1. return apply_filters( 'jetpack_get_module', $mod, $module, $file );