merge table fixes

This commit is contained in:
Mike Jolley 2016-06-06 19:29:47 +01:00
parent 8ef3957ad1
commit 00cd6f7f2a
3 changed files with 15 additions and 25 deletions

View File

@ -555,9 +555,11 @@ function woocommerce_walk_category_dropdown_tree( $a1 = '', $a2 = '', $a3 = '' )
/**
* @deprecated
*/
function woocommerce_taxonomy_metadata_wpdbfix() {
return wc_taxonomy_metadata_wpdbfix();
}
function woocommerce_taxonomy_metadata_wpdbfix() {}
/**
* @deprecated
*/
function wc_taxonomy_metadata_wpdbfix() {}
/**
* @deprecated
*/

View File

@ -196,23 +196,6 @@ function wc_walk_category_dropdown_tree() {
return call_user_func_array( array( &$walker, 'walk' ), $args );
}
/**
* WooCommerce Term/Order item Meta API - set table name.
*/
function wc_taxonomy_metadata_wpdbfix() {
global $wpdb;
$termmeta_name = 'woocommerce_termmeta';
$itemmeta_name = 'woocommerce_order_itemmeta';
$wpdb->woocommerce_termmeta = $wpdb->prefix . $termmeta_name;
$wpdb->order_itemmeta = $wpdb->prefix . $itemmeta_name;
$wpdb->tables[] = 'woocommerce_termmeta';
$wpdb->tables[] = 'woocommerce_order_itemmeta';
}
add_action( 'init', 'wc_taxonomy_metadata_wpdbfix', 0 );
add_action( 'switch_blog', 'wc_taxonomy_metadata_wpdbfix', 0 );
/**
* When a term is split, ensure meta data maintained.
* @param int $old_term_id

View File

@ -167,7 +167,8 @@ final class WooCommerce {
add_action( 'init', array( $this, 'init' ), 0 );
add_action( 'init', array( 'WC_Shortcodes', 'init' ) );
add_action( 'init', array( 'WC_Emails', 'init_transactional_emails' ) );
add_action( 'init', array( $this, 'payment_token_metadata_wpdbfix' ), 0 );
add_action( 'init', array( $this, 'wpdb_table_fix' ), 0 );
add_action( 'switch_blog', array( $this, 'wpdb_table_fix' ), 0 );
}
/**
@ -471,12 +472,16 @@ final class WooCommerce {
}
/**
* WooCommerce Payment Token Meta API - set table name
* WooCommerce Payment Token Meta API and Term/Order item Meta - set table names.
*/
function payment_token_metadata_wpdbfix() {
public function wpdb_table_fix() {
global $wpdb;
$wpdb->payment_tokenmeta = $wpdb->prefix . 'woocommerce_payment_tokenmeta';
$wpdb->tables[] = 'woocommerce_payment_tokenmeta';
$wpdb->payment_tokenmeta = $wpdb->prefix . 'woocommerce_payment_tokenmeta';
$wpdb->woocommerce_termmeta = $wpdb->prefix . 'woocommerce_termmeta';
$wpdb->order_itemmeta = $wpdb->prefix . 'woocommerce_order_itemmeta';
$wpdb->tables[] = 'woocommerce_payment_tokenmeta';
$wpdb->tables[] = 'woocommerce_termmeta';
$wpdb->tables[] = 'woocommerce_order_itemmeta';
}
/**