mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Display the correct Slug in the permalink preview. Props duck_. Fixes #12870
git-svn-id: https://develop.svn.wordpress.org/trunk@14124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user