Codex tools: Log in
Contents |
Sanitizes title, replacing whitespace with dashes.
Limits the output to alphanumeric characters, underscore (_) and dash (-). Whitespace becomes a dash.
Note that it does not replace special accented characters (see plugins such as [1] to fix that).
<?php sanitize_title_with_dashes( $title ) ?>
<?php
echo sanitize_title_with_dashes("I'm in LOVE with WordPress!!!1");
// this will print: im-in-love-with-wordpress1
?>
Since: 1.2.0
sanitize_title_with_dashes() is located in wp-includes/formatting.php#L842.
sanitize_title_with_dashes() 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: