تابع wc_update_200_subcat_display بروزرسانی زیر دسته های ووکامرس به نسخه 2

تابع ووکامرسی wc_update_200_subcat_display – بروزرسانی زیر دسته های ووکامرس به نسخه 2
Syntax – سینتکس
wc_update_200_subcat_display();
Usage – نحوه استفاده
if ( !function_exists( 'wc_update_200_subcat_display' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_update_200_subcat_display();
Defined – محل تعریف
/includes/wc-update-functions.php
function wc_update_200_subcat_display() {
// Update subcat display settings
if ( get_option( 'woocommerce_shop_show_subcategories' ) == 'yes' ) {
if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) {
update_option( 'woocommerce_shop_page_display', 'subcategories' );
} else {
update_option( 'woocommerce_shop_page_display', 'both' );
}
}
if ( get_option( 'woocommerce_show_subcategories' ) == 'yes' ) {
if ( get_option( 'woocommerce_hide_products_when_showing_subcategories' ) == 'yes' ) {
update_option( 'woocommerce_category_archive_display', 'subcategories' );
} else {
update_option( 'woocommerce_category_archive_display', 'both' );
}
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر