Make WordPress Core

Ticket #46266: 46266.diff

File 46266.diff, 746 bytes (added by earnjam, 6 years ago)
  • src/wp-admin/includes/post.php

    diff --git src/wp-admin/includes/post.php src/wp-admin/includes/post.php
    index 0e19876e51..8e1ee20afe 100644
    function get_sample_permalink( $id, $title = null, $name = null ) { 
    13371337        $original_name   = $post->post_name;
    13381338
    13391339        // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
    1340         if ( in_array( $post->post_status, array( 'draft', 'pending', 'future' ) ) ) {
     1340        if ( in_array( $post->post_status, array( 'auto-draft', 'draft', 'pending', 'future' ) ) ) {
    13411341                $post->post_status = 'publish';
    13421342                $post->post_name   = sanitize_title( $post->post_name ? $post->post_name : $post->post_title, $post->ID );
    13431343        }