sanitize_hex_color
sanitize_hex_color ( $color )
Parameters:Returns:Defined at: - Introduced in WordPress: 3.4.0
- Deprecated in WordPress: —
Description
Sanitizes a hex color.Returns either '', a 3 or 6 digit hex color (with #), or nothing.
For sanitizing values without a #, see sanitize_hex_color_no_hash().