diff --git a/wp-includes/post.php b/wp-includes/post.php index 48fe341655..df2c3b545d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4217,6 +4217,20 @@ function wp_update_post( $postarr = array(), $wp_error = false ) { return wp_insert_attachment( $postarr, false, 0, $wp_error ); } + // Discard 'tags_input' parameter if it's the same as existing post tags. + if ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $postarr['post_type'], 'post_tag' ) ) { + $tags = get_the_terms( $postarr['ID'], 'post_tag' ); + $tag_names = array(); + + if ( $tags && ! is_wp_error( $tags ) ) { + $tag_names = wp_list_pluck( $tags, 'name' ); + } + + if ( $postarr['tags_input'] === $tag_names ) { + unset( $postarr['tags_input'] ); + } + } + return wp_insert_post( $postarr, $wp_error ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 82667a4473..25292cf4f0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta2-47313'; +$wp_version = '5.4-beta2-47317'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.