sort_fields

The WooCommerce Checkout Manager sort fields function.

Description

sort_fields( $a, $b ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'sort_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/classes/field_filters.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 = sort_fields($a, $b); 
  12.  

Defined (1)

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

/includes/classes/field_filters.php  
  1. function sort_fields( $a, $b ) { 
  2. if ( $a['order'] == $b['order'] ) 
  3. return 0; 
  4. return ( $a['order'] < $b['order'] ) ? -1 : 1;