jetpack_protect_get_local_whitelist

Gets the local Protect whitelist.

Description

(array) jetpack_protect_get_local_whitelist(); 

The local part of the whitelist only really applies to multisite installs, which can have a network wide whitelist, as well as a local list that applies only to the current site. On single site installs, there will only be a local whitelist.

Returns (array)

A list of IP Address objects or an empty array


Usage

  1. if ( !function_exists( 'jetpack_protect_get_local_whitelist' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/protect/shared-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_protect_get_local_whitelist(); 
  7.  

Defined (1)

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

/modules/protect/shared-functions.php  
  1. function jetpack_protect_get_local_whitelist() { 
  2. $whitelist = Jetpack_Options::get_option( 'protect_whitelist' ); 
  3.  
  4. if ( false === $whitelist ) { 
  5. // The local whitelist has never been set 
  6. if ( is_multisite() ) { 
  7. // On a multisite, we can check for a legacy site_option that existed prior to v 3.6, or default to an empty array 
  8. $whitelist = get_site_option( 'jetpack_protect_whitelist', array () ); 
  9. } else { 
  10. // On a single site, we can just use an empty array 
  11. $whitelist = array (); 
  12.  
  13. return $whitelist;