Ensure that draft posts cannot be given a non-unique post slug when using Quick Edit.

fixes #22902. props SergeyBiryukov.

git-svn-id: https://develop.svn.wordpress.org/trunk@24206 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2013-05-08 21:26:17 +00:00
parent 0b5b837917
commit cf2a8e08d2
2 changed files with 8 additions and 3 deletions
+2 -3
View File
@@ -995,9 +995,8 @@ function get_sample_permalink($id, $title = null, $name = null) {
$original_date = $post->post_date;
$original_name = $post->post_name;
// Hack: get_permalink would return ugly permalink for
// drafts, so we will fake, that our post is published
if ( in_array($post->post_status, array('draft', 'pending')) ) {
// Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
$post->post_status = 'publish';
$post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
}