Merge pull request #20094 from woocommerce/fix/20051
When cleaning up CSV import, only remove product taxonomies
This commit is contained in:
commit
7302d21a55
|
@ -258,11 +258,15 @@ class WC_Admin_Importers {
|
|||
LEFT JOIN {$wpdb->posts} wp ON wp.ID = {$wpdb->postmeta}.post_id
|
||||
WHERE wp.ID IS NULL
|
||||
" );
|
||||
// @codingStandardsIgnoreStart.
|
||||
$wpdb->query( "
|
||||
DELETE {$wpdb->term_relationships}.* FROM {$wpdb->term_relationships}
|
||||
LEFT JOIN {$wpdb->posts} wp ON wp.ID = {$wpdb->term_relationships}.object_id
|
||||
DELETE tr.* FROM {$wpdb->term_relationships} tr
|
||||
LEFT JOIN {$wpdb->posts} wp ON wp.ID = tr.object_id
|
||||
LEFT JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
||||
WHERE wp.ID IS NULL
|
||||
AND tt.taxonomy IN ( '" . implode( "','", array_map( 'esc_sql', get_object_taxonomies( 'product' ) ) ) . "' )
|
||||
" );
|
||||
// @codingStandardsIgnoreEnd.
|
||||
|
||||
// Send success.
|
||||
wp_send_json_success(
|
||||
|
|
Loading…
Reference in New Issue