Add wp_unique_post_slug(). Apply it when getting sample permalinks. Props nbachiyski. fixes #6595

git-svn-id: https://develop.svn.wordpress.org/trunk@11071 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-04-23 20:21:18 +00:00
parent ac40df7d99
commit 5e6528cd14
2 changed files with 36 additions and 15 deletions

View File

@@ -927,6 +927,8 @@ function get_sample_permalink($id, $title=null, $name = null) {
$post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID);
}
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
// If the user wants to set a new name -- override the current one
// Note: if empty name is supplied -- use the title instead, see #6072
if (!is_null($name)) {