New title functions.

git-svn-id: http://svn.automattic.com/wordpress/trunk@465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-10-25 22:05:38 +00:00
parent 8a00feabc2
commit 44cde8f911
1 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,16 @@ function wpautop($pee, $br=1) {
return $pee;
}
function sanitize_title($title) {
$title = strtolower($title);
$title = preg_replace('/&.+;/', '', $title); // kill entities
$title = preg_replace('/[^a-z0-9 ]/', '', $title);
$title = preg_replace('/\s+/', ' ', $title);
$title = trim($title);
$title = str_replace(' ', '-', $title);
return $title;
}
function popuplinks($text) {
// Comment text in popup windows should be filtered through this.
// Right now it's a moderately dumb function, ideally it would detect whether