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



maybe_hash_hex_color › WordPress Function

Da3.4.0
Deprecaton/a
maybe_hash_hex_color ( $color )
Parametri:
  • (string) $color
    Richiesto:
Ritorna:
  • (string)
Definito a:
Codex:

Ensures that any hex color is properly hashed.

Otherwise, returns value untouched. This method should only be necessary if using sanitize_hex_color_no_hash().


Sorgenti

function maybe_hash_hex_color( $color ) {
	$unhashed = sanitize_hex_color_no_hash( $color );
	if ( $unhashed ) {
		return '#' . $unhashed;
	}

	return $color;
}