Core Function
View Source on Trac ↗ wp_privacy_anonymize_ip()
wp_privacy_anonymize_ip( mixed $ip_addr, mixed $ipv6_fallback = false ) Returns an anonymized IPv4 or IPv6 address.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $ip_addr string | The IPv4 or IPv6 address to be anonymized. Required |
| bool | $ipv6_fallback Optional. Whether to return the original IPv6 address if the needed functions to anonymize it are not present. Default false, return `::` (unspecified address). Required |
Return Value
(string)
The anonymized IP address.
Function Information
Since Version
4.9.6 Abstracted from `WP_Community_Events::get_unsafe_client_ip()`.
Source File
wp-includes/functions.php
Advertisement