rest_is_ip_address

Advertisement

Summery Summery

Determines if an IP address is valid.

Syntax Syntax

rest_is_ip_address( string $ip )

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

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply