wc_shipping_zone_method_order_uasort_comparison

Used to sort shipping zone methods with uasort.

Description

wc_shipping_zone_method_order_uasort_comparison( $a, $b ); 

Parameters (2)

0. $a
The a.
1. $b
The b.

Usage

  1. if ( !function_exists( 'wc_shipping_zone_method_order_uasort_comparison' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // The a. 
  5. $a = null; 
  6.  
  7. // The b. 
  8. $b = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_shipping_zone_method_order_uasort_comparison($a, $b); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-core-functions.php  
  1. function wc_shipping_zone_method_order_uasort_comparison( $a, $b ) { 
  2. if ( $a->method_order === $b->method_order ) { 
  3. return 0; 
  4. return ( $a->method_order < $b->method_order ) ? -1 : 1;