When creating a new post with an empty `post_name` and `post_title`, don't generate a `post_name` that conflicts with a date archive permalink.
See #5305. Built from https://develop.svn.wordpress.org/trunk@33261 git-svn-id: http://core.svn.wordpress.org/trunk@33233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4ee0da1798
commit
5a1618b497
|
@ -3451,7 +3451,7 @@ function wp_insert_post( $postarr, $wp_error = false ) {
|
|||
}
|
||||
|
||||
if ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) {
|
||||
$data['post_name'] = sanitize_title( $data['post_title'], $post_ID );
|
||||
$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent );
|
||||
$wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where );
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-beta2-33259';
|
||||
$wp_version = '4.3-beta2-33261';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue