Coding standards and changelog for #13867

This commit is contained in:
Claudio Sanches 2017-04-04 11:40:02 -03:00
parent faf0104b49
commit d881bf0500
2 changed files with 17 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class WC_Meta_Box_Product_Data {
),
) );
// Sort tabs based on priority
// Sort tabs based on priority.
uasort( $tabs, array( __CLASS__, 'product_data_tabs_sort' ) );
return $tabs;
@ -128,10 +128,22 @@ class WC_Meta_Box_Product_Data {
/**
* Callback to sort product data tabs on priority.
*
* @since 3.1.0
* @param int $a First item.
* @param int $b Second item.
*
* @return bool
*/
private static function product_data_tabs_sort( $a, $b ) {
if ( ! isset( $a['priority'], $b['priority'] ) ) return -1;
if ( $a['priority'] == $b['priority'] ) return 0;
if ( ! isset( $a['priority'], $b['priority'] ) ) {
return -1;
}
if ( $a['priority'] == $b['priority'] ) {
return 0;
}
return $a['priority'] < $b['priority'] ? -1 : 1;
}

View File

@ -163,7 +163,8 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
= 3.1.0 - 2017-xx-xx =
* Included WooCommerce endpoints as options nav menu settings on Customize.
* Updated Emogrifier to version 1.2.
* Dev - Updated Emogrifier to version 1.2.
* Dev - Sort product data tabs by priority in admin screen.
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt).