函数原型
maybe_hash_hex_color( string $color ): string
函数描述
Ensures that any hex color is properly hashed.
是否弃用
未弃用
函数参数
-
$color
string
Required
函数返回值
string
函数位置
File: wp-includes/formatting.php.
函数源码
function maybe_hash_hex_color( $color ) {
$unhashed = sanitize_hex_color_no_hash( $color );
if ( $unhashed ) {
return '#' . $unhashed;
}
return $color;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |

