How to set your IP address during local development
It is common to develop WordPress projects locally, where your IP address reflects your local machine. Because Logic Hop uses visitor IP addresses for geolocation and other data, you often need to test with a valid or specific IP. This guide shows how to override it.
Logic Hop uses visitors' IP addresses in a variety of ways, and it can be important to test with a valid or specific IP address — especially when working with geolocation. During local development your IP usually resolves to your local computer, which makes geolocation conditions impossible to test realistically.
Override your IP address
To override the IP address Logic Hop uses, implement the logichop_get_client_ip filter. To set a specific address, return the IP you want from the filter — for example, a function hooked to logichop_get_client_ip that returns '72.85.30.42'. Swap in any valid IP of your choice. Note that the filter only accepts valid IP addresses.
Set a specific IP: return a fixed address such as 72.85.30.42 from the filter
Use the forwarded IP: read HTTP_X_FORWARDED_FOR from $_SERVER and return the first value when present
Questions this page should answer
Which filter overrides the Logic Hop client IP?
Use the logichop_get_client_ip filter. Return a valid IP address from your hooked function to override the address Logic Hop uses for geolocation.