تابع ووکامرسی wc_get_product_category_list نمایش دسته بندی محصولات فروشگاه

تابع ووکامرسی wc_get_product_category_list – نمایش دسته بندی محصولات فروشگاه
Syntax – سینتکس
(string) wc_get_product_category_list( (int) $product_id, (string) $sep = ', ', (string) $before = '', (string) $after = '' );
Parameters – پارامتر ها (4)
- 1- $product_id (int)
- 2- $sep (string)
- 3- $before (string)
- 4- $after (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_get_product_category_list' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-product-functions.php';
}
// The product id.
$product_id = -1;
// (default: ', ').
$sep = ', ';
// (default: '').
$before = '';
// (default: '').
$after = '';
// NOTICE! Understand what this does before running.
$result = wc_get_product_category_list($product_id, $sep, $before, $after);
Defined – محل تعریف
/includes/wc-product-functions.php
function wc_get_product_category_list( $product_id, $sep = ', ', $before = '', $after = '' ) {
return get_the_term_list( $product_id, 'product_cat', $before, $sep, $after );
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر