jetpack_options_whitelist

Filter the list of options that are manageable via the JSON API.

Description

apply_filters( 'jetpack_options_whitelist', (array) $jetpack_sync_defaults_default_options_whitelist, (bool) $this_site_option ); 

Parameters (2)

0. $jetpack_sync_defaults_default_options_whitelist (array) => Jetpack_Sync_Defaults::$default_options_whitelist
The jetpack sync defaults default options whitelist.
1. $this_site_option (bool)
Is the option a site option.

Usage

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

Defined (3)

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

/json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php  
  1. if ( ! in_array( $this->option_name, apply_filters( 'jetpack_options_whitelist', Jetpack_Sync_Defaults::$default_options_whitelist, $this->site_option ) ) ) { 
/sync/class.jetpack-sync-defaults.php  
  1. $options_whitelist = apply_filters( 'jetpack_options_whitelist', self::$default_options_whitelist ); 
/sync/class.jetpack-sync-module-options.php  
  1. $late_options = apply_filters( 'jetpack_options_whitelist', array() );