Change the mexican state update routing to only update shipping and billing states, not all meta data which matches. Closes #17066

This commit is contained in:
Gerhard Potgieter 2017-10-05 13:49:10 +02:00
parent 71fce64f54
commit a8e3862bf2
1 changed files with 9 additions and 7 deletions

View File

@ -1371,13 +1371,15 @@ function wc_update_320_mexican_states() {
);
foreach ( $mx_states as $old => $new ) {
$wpdb->update(
$wpdb->postmeta,
array(
'meta_value' => $new,
),
array(
'meta_value' => $old,
$wpdb->query(
$wpdb->prepare(
"
UPDATE $wpdb->postmeta
SET meta_value = %s
WHERE meta_key IN ( '_billing_state', '_shipping_state' )
AND meta_value = %s
",
$new, $old
)
);
$wpdb->update(