diff --git a/includes/admin/class-wc-admin-duplicate-product.php b/includes/admin/class-wc-admin-duplicate-product.php index 7b9c6456496..a880ccc09f2 100644 --- a/includes/admin/class-wc-admin-duplicate-product.php +++ b/includes/admin/class-wc-admin-duplicate-product.php @@ -133,35 +133,34 @@ class WC_Admin_Duplicate_Product { $post_content_filtered = str_replace("'", "''", $post->post_content_filtered); $post_excerpt = str_replace("'", "''", $post->post_excerpt); $post_title = str_replace("'", "''", $post->post_title).$suffix; - $post_name = str_replace("'", "''", $post->post_name); $comment_status = str_replace("'", "''", $post->comment_status); $ping_status = str_replace("'", "''", $post->ping_status); // Insert the new template in the post table $wpdb->insert( - $wpdb->posts, - array( - 'post_author' => $new_post_author->ID, - 'post_date' => $new_post_date, - 'post_date_gmt' => $new_post_date_gmt, - 'post_content' => $post_content, - 'post_content_filtered' => $post_content_filtered, - 'post_title' => $post_title, - 'post_excerpt' => $post_excerpt, - 'post_status' => $post_status, - 'post_type' => $new_post_type, - 'comment_status' => $comment_status, - 'ping_status' => $ping_status, - 'post_password' => $post->post_password, - 'to_ping' => $post->to_ping, - 'pinged' => $post->pinged, - 'post_modified' => $new_post_date, - 'post_modified_gmt' => $new_post_date_gmt, - 'post_parent' => $post_parent, - 'menu_order' => $post->menu_order, - 'post_mime_type' => $post->post_mime_type - ) - ); + $wpdb->posts, + array( + 'post_author' => $new_post_author->ID, + 'post_date' => $new_post_date, + 'post_date_gmt' => $new_post_date_gmt, + 'post_content' => $post_content, + 'post_content_filtered' => $post_content_filtered, + 'post_title' => $post_title, + 'post_excerpt' => $post_excerpt, + 'post_status' => $post_status, + 'post_type' => $new_post_type, + 'comment_status' => $comment_status, + 'ping_status' => $ping_status, + 'post_password' => $post->post_password, + 'to_ping' => $post->to_ping, + 'pinged' => $post->pinged, + 'post_modified' => $new_post_date, + 'post_modified_gmt' => $new_post_date_gmt, + 'post_parent' => $post_parent, + 'menu_order' => $post->menu_order, + 'post_mime_type' => $post->post_mime_type + ) + ); $new_post_id = $wpdb->insert_id;