maybe_hash_hex_color( string $color )
Ensures that any hex color is properly hashed.
Description Description
Otherwise, returns value untouched.
This method should only be necessary if using sanitize_hex_color_no_hash().
Parameters Parameters
- $color
-
(string) (Required)
Return Return
(string)
Source Source
File: wp-includes/formatting.php
function maybe_hash_hex_color( $color ) {
$unhashed = sanitize_hex_color_no_hash( $color );
if ( $unhashed ) {
return '#' . $unhashed;
}
return $color;
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |