wc_update_200_images

The WooCommerce wc update 200 images function.

Description

wc_update_200_images(); 

Usage

  1. if ( !function_exists( 'wc_update_200_images' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_update_200_images(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-update-functions.php  
  1. function wc_update_200_images() { 
  2. // Grab the pre 2.0 Image options and use to populate the new image options settings,  
  3. // cleaning up afterwards like nice people do 
  4. foreach ( array( 'catalog', 'single', 'thumbnail' ) as $value ) { 
  5.  
  6. $old_settings = array_filter( array( 
  7. 'width' => get_option( 'woocommerce_' . $value . '_image_width' ),  
  8. 'height' => get_option( 'woocommerce_' . $value . '_image_height' ),  
  9. 'crop' => get_option( 'woocommerce_' . $value . '_image_crop' ),  
  10. ) ); 
  11.  
  12. if ( ! empty( $old_settings ) && update_option( 'shop_' . $value . '_image_size', $old_settings ) ) { 
  13.  
  14. delete_option( 'woocommerce_' . $value . '_image_width' ); 
  15. delete_option( 'woocommerce_' . $value . '_image_height' ); 
  16. delete_option( 'woocommerce_' . $value . '_image_crop' ); 
  17.