This commit is contained in:
Mike Jolley 2014-10-07 11:05:40 +01:00
parent 3f6e6309be
commit c6c5265493
1 changed files with 23 additions and 24 deletions

View File

@ -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;