WordPress 常用函数 / sanitize_key
清理 key 字符串,keys 是用来作为内部的标示符。
只允许消息数字和字母,破折号和下划线。
<?php sanitize_key( $key ); ?>
<?php sanitize_key( $key ); ?>$key
(string) (required) String key
Default: None
(string)
Sanitized key
'sanitize_key':apply_filters( 'sanitize_key', $key, $raw_key )
Since: 3.0.0
/wp-includes/formatting.php