jetpack_wpcom_theme_skip_download

Filters whether to skip the standard method of downloading and validating a WordPress.com theme.

Description

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

An alternative method of WPCom theme download and validation 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 skip the standard method of downloading and validating 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_skip_download', $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_skip_download callback 
  2. function filter_jetpack_wpcom_theme_skip_download( $false, $theme ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_wpcom_theme_skip_download', 'filter_jetpack_wpcom_theme_skip_download', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_wpcom_theme_skip_download', 'filter_jetpack_wpcom_theme_skip_download', 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. $skip_download_filter_result = apply_filters( 'jetpack_wpcom_theme_skip_download', false, $theme );