wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



rest_parse_hex_color › WordPress Function

Da5.4.0
Deprecaton/a
rest_parse_hex_color ( $color )
Parametri:
  • (string) $color 3 or 6 digit hex color (with #).
    Richiesto:
Ritorna:
  • (string|false)
Definito a:
Codex:

Parses a 3 or 6 digit hex color (with #).



Sorgenti

function rest_parse_hex_color( $color ) {
	$regex = '|^#([A-Fa-f0-9]{3}){1,2}$|';
	if ( ! preg_match( $regex, $color, $matches ) ) {
		return false;
	}

	return $color;
}