Sanitize a string key. Keys are used as internal identifiers.
Lowercase alphanumeric characters, dashes and underscores are allowed. Uppercase characters will be converted to lowercase. After sanitize_key()
has done its work, it passes the sanitized key through the sanitize_key filter.
<?php sanitize_key( $key ); ?>
apply_filters( 'sanitize_key', $key, $raw_key )
Since: 3.0.0
sanitize_key() is located in /wp-includes/formatting.php
.
sanitize_key()
is in a class of functions that help you sanitize potentially unsafe data which allow you to pass an arbitrary variable and receive the clean version based on data type. Others include: