تابع ووکامرسی woocommerce_sort_product_tabs ترتیب بندی و sort تب های محصول

تابع ووکامرسی woocommerce_sort_product_tabs – ترتیب بندی و sort تب های محصول
Syntax – سینتکس
(array) woocommerce_sort_product_tabs( (array) $tabs = array() );
Parameters – پارامتر ها (1)
- 1- $tabs (array)
Usage – نحوه استفاده
if ( !function_exists( 'woocommerce_sort_product_tabs' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php';
}
// The tabs.
$tabs = array();
// NOTICE! Understand what this does before running.
$result = woocommerce_sort_product_tabs($tabs);
Defined – محل تعریف
/includes/wc-template-functions.php
function woocommerce_sort_product_tabs( $tabs = array() ) {
// Make sure the $tabs parameter is an array
if ( ! is_array( $tabs ) ) {
trigger_error( "Function woocommerce_sort_product_tabs() expects an array as the first parameter. Defaulting to empty array." );
$tabs = array();
}
// Re-order tabs by priority
if ( ! function_exists( '_sort_priority_callback' ) ) {
function _sort_priority_callback( $a, $b ) {
if ( $a['priority'] === $b['priority'] )
return 0;
return ( $a['priority'] < $b['priority'] ) ? -1 : 1;
}
}
uasort( $tabs, '_sort_priority_callback' );
return $tabs;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر