Fix query error when saving tax rates

Fixes #6202
This commit is contained in:
James Collins 2014-09-10 09:47:09 +08:00
parent 2f1533ff94
commit 1e251d36b6
1 changed files with 3 additions and 1 deletions

View File

@ -723,7 +723,9 @@ class WC_Settings_Tax extends WC_Settings_Page {
}
}
$wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) );
if ( !empty( $postcode_query ) ) {
$wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) );
}
}