_usort_terms_by_ID

Sort categories by ID.

Description

(int) _usort_terms_by_ID( (object) $a, (object) $b ); 

Used by usort() as a callback, should not be used directly. Can actually be used to sort any term object.

Returns (int)

Parameters (2)

0. $a (object)
The a.
1. $b (object)
The b.

Usage

  1. if ( !function_exists( '_usort_terms_by_ID' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.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 = _usort_terms_by_ID($a, $b); 
  12.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function _usort_terms_by_ID( $a, $b ) { 
  2. _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' ); 
  3.  
  4. if ( $a->term_id > $b->term_id ) 
  5. return 1; 
  6. elseif ( $a->term_id < $b->term_id ) 
  7. return -1; 
  8. else 
  9. return 0;