jetpack_wpcom_theme_install

Filters whether to use an alternative process for installing a WordPress.com theme.

Description

apply_filters( 'jetpack_wpcom_theme_install', (bool) $false, (string) $theme ); 

The alternative process can be executed during the filter.

The filter can also return an instance of WP_Error; in which case the endpoint response will contain this error.

Parameters (2)

0. $false (bool) => false
Whether to use the alternative method of installing a WPCom theme.
1. $theme (string)
Theme name (slug). If it is a WPCom theme, it should be suffixed with -wpcom..

Usage

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

Defined (1)

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

/json-endpoints/jetpack/class.jetpack-json-api-themes-install-endpoint.php  
  1. $result = apply_filters( 'jetpack_wpcom_theme_install', false, $theme );