Added upgrade script for #9868

cc @mikejolley
This commit is contained in:
Claudio Sanches 2015-12-17 08:30:06 -02:00
parent 792dd9d7d1
commit c04443c2d3
2 changed files with 36 additions and 1 deletions

View File

@ -25,7 +25,8 @@ class WC_Install {
'2.2.0' => 'updates/woocommerce-update-2.2.php',
'2.3.0' => 'updates/woocommerce-update-2.3.php',
'2.4.0' => 'updates/woocommerce-update-2.4.php',
'2.4.1' => 'updates/woocommerce-update-2.4.1.php'
'2.4.1' => 'updates/woocommerce-update-2.4.1.php',
'2.5.0' => 'updates/woocommerce-update-2.5.php',
);
/**

View File

@ -0,0 +1,34 @@
<?php
/**
* Update WC to 2.5.0
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Updates
* @version 2.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $wpdb;
// Fix currency settings for LAK currency.
$current_currency = get_option( 'woocommerce_currency' );
if ( 'KIP' === $current_currency ) {
update_option( 'woocommerce_currency', 'LAK' );
}
// Update LAK currency code.
$wpdb->update(
$wpdb->postmeta,
array(
'meta_value' => 'LAK'
),
array(
'meta_key' => '_order_currency',
'meta_value' => 'KIP'
)
);