Merge pull request #17521 from woocommerce/fix/sort-tabs-callback

For code doing it wrong, ensure priority is set
This commit is contained in:
Claudiu Lodromanean 2017-11-02 10:46:17 -07:00 committed by GitHub
commit d1157d6f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1237,7 +1237,7 @@ if ( ! function_exists( 'woocommerce_sort_product_tabs' ) ) {
* @return bool
*/
function _sort_priority_callback( $a, $b ) {
if ( $a['priority'] === $b['priority'] ) {
if ( ! isset( $a['priority'], $b['priority'] ) || $a['priority'] === $b['priority'] ) {
return 0;
}
return ( $a['priority'] < $b['priority'] ) ? -1 : 1;