only delete the old options if we successfully update

This commit is contained in:
Neil Pie 2013-02-07 13:55:23 +00:00
parent a8de6cef2b
commit 48d3a1e437
1 changed files with 1 additions and 2 deletions

View File

@ -309,9 +309,8 @@ foreach ( array( 'catalog', 'single', 'thumbnail' ) as $value ) {
'crop' => get_option( 'woocommerce_' . $value . '_image_crop' )
) );
if ( ! empty( $old_settings ) ){
if ( ! empty( $old_settings ) && update_option( 'shop_' . $value . '_image_size', $old_settings ) ){
update_option( 'shop_' . $value . '_image_size', $old_settings ) ;
delete_option( 'woocommerce_' . $value . '_image_width' );
delete_option( 'woocommerce_' . $value . '_image_height' );
delete_option( 'woocommerce_' . $value . '_image_crop' );