WC_Meta_Box_Product_Data::product_data_tabs_sort()private staticWC 3.1.0

Callback to sort product data tabs on priority.

{} It's a method of the class: WC_Meta_Box_Product_Data{}

No Hooks.

Return

true|false.

Usage

$result = WC_Meta_Box_Product_Data::product_data_tabs_sort( $a, $b );
$a(int) (required)
First item.
$b(int) (required)
Second item.

Changelog

Since 3.1.0 Introduced.

Code of WC_Meta_Box_Product_Data::product_data_tabs_sort() WC 6.7.0

private static function product_data_tabs_sort( $a, $b ) {
	if ( ! isset( $a['priority'], $b['priority'] ) ) {
		return -1;
	}

	if ( $a['priority'] === $b['priority'] ) {
		return 0;
	}

	return $a['priority'] < $b['priority'] ? -1 : 1;
}