bb_get_recently_moderated_objects

Stats.

Description

bb_get_recently_moderated_objects( (int) $num = 5 ); 

Parameters (1)

0. $num — Optional. (int) => 5
The num.

Usage

  1. if ( !function_exists( 'bb_get_recently_moderated_objects' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php'; 
  3.  
  4. // The num. 
  5. $num = 5; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_recently_moderated_objects($num); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php  
  1. function bb_get_recently_moderated_objects( $num = 5 ) { 
  2. $post_query = new BB_Query( 'post', array( 'per_page' => $num, 'post_status' => '-normal', 'topic_status' => 0 ) ); // post_time != moderation_time; 
  3. $topic_query = new BB_Query( 'topic', array( 'per_page' => $num, 'topic_status' => '-normal' ) ); // topic_time == topic_start_time != moderation_time; 
  4.  
  5. $objects = array(); 
  6. if ( $post_query->results ) 
  7. foreach ( array_keys($post_query->results) as $key ) 
  8. $objects[bb_gmtstrtotime($post_query->results[$key]->post_time)] = array('type' => 'post', 'data' => $post_query->results[$key]); 
  9. if ( $topic_query->results ) 
  10. foreach ( array_keys($topic_query->results) as $key ) 
  11. $objects[bb_gmtstrtotime($topic_query->results[$key]->topic_time)] = array('type' => 'topic', 'data' => $topic_query->results[$key]); 
  12. krsort($objects); 
  13. return array_slice($objects, 0, $num);