Display the correct Slug in the permalink preview. Props duck_. Fixes #12870

git-svn-id: http://svn.automattic.com/wordpress/trunk@14124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32
2010-04-18 01:46:28 +00:00
parent e56cc6ce28
commit 87bd780ca9
3 changed files with 7 additions and 7 deletions

View File

@@ -1027,13 +1027,13 @@ 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) )
$post->post_name = sanitize_title($name ? $name : $title, $post->ID);
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
$post->filter = 'sample';
$permalink = get_permalink($post, true);