wc_update_260_zones

The WooCommerce wc update 260 zones function.

Description

wc_update_260_zones(); 

Usage

  1. if ( !function_exists( 'wc_update_260_zones' ) ) { 
  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_260_zones(); 
  7.  

Defined (1)

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

/includes/wc-update-functions.php  
  1. function wc_update_260_zones() { 
  2. global $wpdb; 
  3. /** 
  4. * Old (table rate) shipping zones to new core shipping zones migration. 
  5. * zone_enabled and zone_type are no longer used, but it's safe to leave them be. 
  6. */ 
  7. if ( $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}woocommerce_shipping_zones` LIKE 'zone_enabled';" ) ) { 
  8. $wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_shipping_zones CHANGE `zone_type` `zone_type` VARCHAR(40) NOT NULL DEFAULT '';" ); 
  9. $wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_shipping_zones CHANGE `zone_enabled` `zone_enabled` INT(1) NOT NULL DEFAULT 1;" );