jetpack_clean_ip

The Jetpack by WordPress.com jetpack clean ip function.

Description

jetpack_clean_ip( $ip ); 

Parameters (1)

0. $ip
The ip.

Usage

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

Defined (1)

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

/modules/protect/shared-functions.php  
  1. function jetpack_clean_ip( $ip ) { 
  2. $ip = trim( $ip ); 
  3.  
  4. // Check for IPv4 IP cast as IPv6 
  5. if ( preg_match( '/^::ffff:(\d+\.\d+\.\d+\.\d+)$/', $ip, $matches ) ) { 
  6. $ip = $matches[1]; 
  7.  
  8. return $ip;