update logic

This commit is contained in:
Mike Jolley 2012-11-14 12:07:12 +00:00
parent 5d4ff86e55
commit a183b84b43
1 changed files with 5 additions and 4 deletions

View File

@ -79,18 +79,19 @@ function do_install_woocommerce() {
woocommerce_compile_less_styles();
}
// Update version
update_option( 'woocommerce_version', $woocommerce->version );
// Queue upgrades
$current_version = get_option( 'woocommerce_version', null );
$current_db_version = get_option( 'woocommerce_db_version', null );
if ( version_compare( $current_db_version, '1.7', '<' ) && null !== $current_db_version ) {
if ( version_compare( $current_db_version, '1.7', '<' ) && null !== $current_version ) {
update_option( 'woocommerce_needs_update', 1 );
} else {
update_option( 'woocommerce_db_version', $woocommerce->version );
}
// Update version
update_option( 'woocommerce_version', $woocommerce->version );
}