Skip to content

Instantly share code, notes, and snippets.

@JeffMatson
Last active February 27, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffMatson/f21a081f8f356839bf348bcf21be2996 to your computer and use it in GitHub Desktop.
Save JeffMatson/f21a081f8f356839bf348bcf21be2996 to your computer and use it in GitHub Desktop.
Filters the Gravity Forms entry IP.
add_filter( 'gform_ip_address', 'filter_gform_ip_address' );
function filter_gform_ip_address( $ip ) {
// Return the IP address set by the proxy.
// E.g. $_SERVER['HTTP_X_FORWARDED_FOR'] or $_SERVER['HTTP_CLIENT_IP']
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment