apply_filters( 'sanitize_key', string $key, string $raw_key )

Filters a sanitized key string.

Parameters

$key

(string) Sanitized key.

$raw_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

File: wp-includes/formatting.php

View on Trac

Changelog

Version Description
3.0.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/sanitize_key