From d48bf556f24ee74f694388a9440b365b9692fa90 Mon Sep 17 00:00:00 2001 From: Sagar Deshmukh Date: Fri, 15 May 2020 17:54:32 +0530 Subject: [PATCH] Prevent duplicate postmeta records insertion --- src/class-wp-import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class-wp-import.php b/src/class-wp-import.php index 57ced62..69195b0 100644 --- a/src/class-wp-import.php +++ b/src/class-wp-import.php @@ -895,7 +895,7 @@ function process_posts() { $value = maybe_unserialize( $meta['value'] ); } - add_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) ); + update_post_meta( $post_id, wp_slash( $key ), wp_slash_strings_only( $value ) ); do_action( 'import_post_meta', $post_id, $key, $value );