diff --git a/wp-includes/post.php b/wp-includes/post.php index d0bc1a3d86..f13d34b823 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2872,7 +2872,8 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) { * @type string $ping_status Whether the post can accept pings. Accepts 'open' or 'closed'. * Default is the value of 'default_ping_status' option. * @type string $post_password The password to access the post. Default empty. - * @type string $post_name The post name. Default is the sanitized post title. + * @type string $post_name The post name. Default is the sanitized post title + * when creating a new post. * @type string $to_ping Space or carriage return-separated list of URLs to ping. * Default empty. * @type string $pinged Space or carriage return-separated list of URLs that have @@ -2953,6 +2954,9 @@ function wp_insert_post( $postarr, $wp_error = false ) { $post_excerpt = $postarr['post_excerpt']; if ( isset( $postarr['post_name'] ) ) { $post_name = $postarr['post_name']; + } elseif ( $update ) { + // For an update, don't modify the post_name if it wasn't supplied as an argument. + $post_name = $post_before->post_name; } $maybe_empty = 'attachment' !== $post_type diff --git a/wp-includes/version.php b/wp-includes/version.php index 64d412d28c..86811f4c11 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-35799'; +$wp_version = '4.5-alpha-35800'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.