wc_update_300_grouped_products update routine needs to unset the post_parent on grouped products

Fixes #14507
This commit is contained in:
Mike Jolley 2017-04-19 10:35:39 +01:00
parent 372656d137
commit 5d7aa234b0
1 changed files with 12 additions and 1 deletions

View File

@ -1020,7 +1020,18 @@ function wc_update_300_grouped_products() {
'post_type' => 'product',
'fields' => 'ids',
) );
add_post_meta( $parent_id, '_children', $children_ids, true );
update_post_meta( $parent_id, '_children', $children_ids );
// Update children to remove the parent.
$wpdb->update(
$wpdb->posts,
array(
'post_parent' => 0,
),
array(
'post_parent' => $parent_id,
)
);
}
}
}