Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




sanitize_key [ WordPress Function ]

sanitize_key ( $key )
Parameters:
  • (string) $key String key
Returns:
  • (string) Sanitized key
Defined at:



Sanitize a string key.

Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.

Source


<?php
function sanitize_key$key ) {
    
$raw_key $key;
    
$key strtolower$key );
    
$key preg_replace'/[^a-z0-9_\-]/'''$key );
    return 
apply_filters'sanitize_key'$key$raw_key );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics