strip leading and trailing dashes from post slugs
git-svn-id: https://develop.svn.wordpress.org/trunk@1336 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
63f7bf9723
commit
5ffeea8e7c
@ -91,7 +91,7 @@ function sanitize_title_with_dashes($title) {
|
||||
$title = preg_replace('/\s+/', ' ', $title);
|
||||
$title = str_replace(' ', '-', $title);
|
||||
$title = preg_replace('|-+|', '-', $title);
|
||||
$title = trim($title);
|
||||
$title = trim($title, '-');
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user