New title functions.
git-svn-id: https://develop.svn.wordpress.org/trunk@465 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
64c998dc3d
commit
49527093ec
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue