Summery Summery
Determines if an IP address is valid.
Syntax Syntax
Description Description
Handles both IPv4 and IPv6 addresses.
Parameters Parameters
- $ip
-
(Required) IP address.
Return Return
(string|false) The valid IP address, otherwise false.
Source Source
File: wp-includes/rest-api.php
* Parses a 3 or 6 digit hex color (with #). * * @since 5.4.0 * * @param string $color 3 or 6 digit hex color (with #). * @return string|false */ function rest_parse_hex_color( $color ) { $regex = '|^#([A-Fa-f0-9]{3}){1,2}$|';
Advertisement
Changelog Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |