_wc_get_product_terms_name_num_usort_callback

Sort by name (numeric).

Description

(int) _wc_get_product_terms_name_num_usort_callback( (WP_POST) $a, (WP_POST) $b ); 

Returns (int)

Parameters (2)

0. $a (WP_POST)
Object $a
1. $b (WP_POST)
Object $b

Usage

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

Defined (1)

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

/includes/wc-term-functions.php  
  1. function _wc_get_product_terms_name_num_usort_callback( $a, $b ) { 
  2. $a_name = (int) $a->name; 
  3. $b_name = (int) $b->name; 
  4.  
  5. if ( $a_name === $b_name ) { 
  6. return 0; 
  7. return ( $a_name < $b_name ) ? -1 : 1;