تابع wc_product_attribute_uasort_comparison نمایش محصولات بر اساس مقایسه آن

تابع ووکامرسی wc_product_attribute_uasort_comparison نمایش محصولات بر اساس مقایسه آن مورد 1 و مورد 2
Syntax – سینتکس
wc_product_attribute_uasort_comparison( $a, $b );
Parameters – پارامتر ها (2)
- 1- $a
- 2- $b
Usage – نحوه استفاده
if ( !function_exists( 'wc_product_attribute_uasort_comparison' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php';
}
// The a.
$a = null;
// The b.
$b = null;
// NOTICE! Understand what this does before running.
$result = wc_product_attribute_uasort_comparison($a, $b);
Defined – محل تعریف
/includes/wc-core-functions.php
function wc_product_attribute_uasort_comparison( $a, $b ) {
if ( $a['position'] === $b['position'] ) {
return 0;
}
return ( $a['position'] < $b['position'] ) ? -1 : 1;
}
versions – نسخه ها
از نسخه : 2.6.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر