1. 首页
  2. WordPress 函数手册

sanitize_hex_color_no_hash()

sanitize_hex_color_no_hash( string $color )

清除不带哈希的十六进制颜色。尽可能使用sanitize_hex_color()。
Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.

目录锚点:#说明#参数#返回#源码


说明(Description)

保存没有散列的十六进制颜色会增加在UI上添加散列的负担,这使得很难使用或升级到其他颜色类型,如rgb a、hsl、rgb和html颜色名称。


参数(Parameters)

参数 类型 必填 说明
$color (string) 必需

返回(Return)

(string|null)


源码(Source)


更新版本 源码位置 使用 被使用
3.4.0 wp-includes/formatting.php:5975 2 1 function

sanitize_hex_color_no_hash() 为WP2原创文章,链接:https://www.wp2.cn/functions/sanitize_hex_color_no_hash/