sanitize_key WordPress Filter Hook
The sanitize_key wordpress hook is used to sanitize a string key. This is useful for ensuring that a string key is properly formatted for use in a wordpress database.
apply_filters( 'sanitize_key', string $sanitized_key , string $key ) #
Filters a sanitized key string.
Parameters
- $sanitized_key
(string)Sanitized key.
- $key
(string)The key prior to sanitization.
More Information
- By default, sanitize_key() function sanitize a string key, which is used as internal identifiers, into lowercase alphanumeric, dashes, and underscores characters. After sanitize_key() function has done its work, it passes the sanitized key through this
sanitize_key
filter. - The filter passes $key and $raw_key as parameters, which allows the user of this filter to perform additional sanitization based on these two keys.
Source
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |