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 ) { foreach ( $mx_states as $old => $new ) {
$wpdb->update( $wpdb->query(
$wpdb->postmeta, $wpdb->prepare(
array( "
'meta_value' => $new, UPDATE $wpdb->postmeta
), SET meta_value = %s
array( WHERE meta_key IN ( '_billing_state', '_shipping_state' )
'meta_value' => $old, AND meta_value = %s
",
$new, $old
) )
); );
$wpdb->update( $wpdb->update(