WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51427


Ignore:
Timestamp:
10/15/2020 01:12:39 PM (12 months ago)
Author:
SergeyBiryukov
Comment:

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #50447.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51427

    • Property Keywords dev-feedback removed
    • Property Status changed from new to closed
    • Property Resolution changed from to duplicate
    • Property Milestone changed from Awaiting Review to
  • Ticket #51427 – Description

    initial v1  
    33Solution is to use code as below  in wp-includes/post.php:
    44(function name: wp_publish_post)
    5 
     5{{{
    66$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, 'publish', $post->post_type, $post->post_parent);
    77
    88$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish', 'post_name' => $post->post_name), array( 'ID' => $post->ID ) );
     9}}}