WordPress.org

Make WordPress Core

Ticket #47988: 47988-20190906-1249.diff

File 47988-20190906-1249.diff, 534 bytes (added by ajfleming, 2 months ago)

A possible solution would wp_unique_post_slug() returning an empty string for draft posts instead of the passed value.

  • wp-includes/post.php

    diff --git a/wp-includes/post.php b/wp-includes/post.php
    index ac29d9628f..f368dffcb2 100644
    a b function check_and_publish_future_post( $post_id ) { 
    41234123 */
    41244124function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
    41254125        if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) || 'user_request' === $post_type ) {
    4126                 return $slug;
     4126                return '';
    41274127        }
    41284128
    41294129        /**