wc_update_260_termmeta

The WooCommerce wc update 260 termmeta function.

Description

wc_update_260_termmeta(); 

Usage

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

Defined (1)

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

/includes/wc-update-functions.php  
  1. function wc_update_260_termmeta() { 
  2. global $wpdb; 
  3. /** 
  4. * Migrate term meta to WordPress tables 
  5. */ 
  6. if ( get_option( 'db_version' ) >= 34370 && $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_termmeta';" ) ) { 
  7. if ( $wpdb->query( "INSERT INTO {$wpdb->termmeta} ( term_id, meta_key, meta_value ) SELECT woocommerce_term_id, meta_key, meta_value FROM {$wpdb->prefix}woocommerce_termmeta;" ) ) { 
  8. $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}woocommerce_termmeta" ); 
  9. wp_cache_flush();