Make WordPress Core


Ignore:
Timestamp:
05/08/2013 09:26:17 PM (9 years ago)
Author:
markjaquith
Message:

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

fixes #22902. props SergeyBiryukov.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r24042 r24206  
    996996    $original_name = $post->post_name;
    997997
    998     // Hack: get_permalink would return ugly permalink for
    999     // drafts, so we will fake, that our post is published
    1000     if ( in_array($post->post_status, array('draft', 'pending')) ) {
     998    // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
     999    if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
    10011000        $post->post_status = 'publish';
    10021001        $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
Note: See TracChangeset for help on using the changeset viewer.