wc_taxonomy_metadata_migrate_data انتقال اطلاعات ترم از ووکامرس به وردپرس

تابع ووکامرسی wc_taxonomy_metadata_migrate_data – انتقال اطلاعات ترم از ووکامرس به وردپرس
Syntax – سینتکس
wc_taxonomy_metadata_migrate_data( $wp_db_version, $wp_current_db_version );
Parameters – پارامتر ها (4)
- 1- $wp_db_version
- 2- $wp_current_db_version
Usage – نحوه استفاده
if ( !function_exists( 'wc_taxonomy_metadata_migrate_data' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-term-functions.php';
}
// The new $wp_db_version.
$wp_db_version = '';
// The old (current) $wp_db_version.
$wp_current_db_version = '';
// NOTICE! Understand what this does before running.
$result = wc_taxonomy_metadata_migrate_data($wp_db_version, $wp_current_db_version);
Defined – محل تعریف
/includes/wc-term-functions.php
function wc_taxonomy_metadata_migrate_data( $wp_db_version, $wp_current_db_version ) {
if ( $wp_db_version >= 34370 && $wp_current_db_version < 34370 ) {
global $wpdb;
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;" ) ) {
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}woocommerce_termmeta" );
}
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر