_bbp_forum_query_usort_subforum_ids

Callback to sort forum ID's based on last active time.

Description

_bbp_forum_query_usort_subforum_ids( (int) $a = 0, (int) $b = 0 ); 

Parameters (2)

0. $a — Optional. (int)
First forum ID to compare
1. $b — Optional. (int)
Second forum ID to compare

Usage

  1. if ( !function_exists( '_bbp_forum_query_usort_subforum_ids' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/forums/functions.php'; 
  3.  
  4. // First forum ID to compare 
  5. $a = -1; 
  6.  
  7. // Second forum ID to compare 
  8. $b = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = _bbp_forum_query_usort_subforum_ids($a, $b); 
  12.  

Defined (1)

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

/includes/forums/functions.php  
  1. function _bbp_forum_query_usort_subforum_ids( $a = 0, $b = 0 ) { 
  2. $ta = get_post_meta( $a, '_bbp_last_active_time', true ); 
  3. $tb = get_post_meta( $b, '_bbp_last_active_time', true ); 
  4. return ( $ta < $tb ) ? -1 : 1;