diff --git a/wp-includes/post.php b/wp-includes/post.php index d999c7bfeb..b434ae52e4 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4142,6 +4142,8 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) if ( ! empty( $postarr['post_category'] ) ) { // Filter out empty terms. $post_category = array_filter( $postarr['post_category'] ); + } elseif ( $update && ! isset( $postarr['post_category'] ) ) { + $post_category = $post_before->post_category; } // Make sure we set a valid category. diff --git a/wp-includes/version.php b/wp-includes/version.php index e55896f474..e8557ce318 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53882'; +$wp_version = '6.1-alpha-53883'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.