bbp_split_topic_count

Fix counts on topic split.

Description

bbp_split_topic_count( (int) $from_reply_id, (int) $source_topic_id, (int) $destination_topic_id ); 

When a topic is split, update the counts of source and destination topic and their forums.

Parameters (3)

0. $from_reply_id (int)
The from reply id.
1. $source_topic_id (int)
The source topic id.
2. $destination_topic_id (int)
The destination topic id.

Usage

  1. if ( !function_exists( 'bbp_split_topic_count' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/topics/functions.php'; 
  3.  
  4. // The from reply id. 
  5. $from_reply_id = -1; 
  6.  
  7. // The source topic id. 
  8. $source_topic_id = -1; 
  9.  
  10. // The destination topic id. 
  11. $destination_topic_id = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bbp_split_topic_count($from_reply_id, $source_topic_id, $destination_topic_id); 
  15.  

Defined (1)

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

/includes/topics/functions.php  
  1. function bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_topic_id ) { 
  2.  
  3. // Forum Topic Counts 
  4.  
  5. // Forum Reply Counts 
  6.  
  7. // Topic Reply Counts 
  8. bbp_update_topic_reply_count( $source_topic_id ); 
  9. bbp_update_topic_reply_count( $destination_topic_id ); 
  10.  
  11. // Topic Hidden Reply Counts 
  12. bbp_update_topic_reply_count_hidden( $source_topic_id ); 
  13. bbp_update_topic_reply_count_hidden( $destination_topic_id ); 
  14.  
  15. // Topic Voice Counts 
  16. bbp_update_topic_voice_count( $source_topic_id ); 
  17. bbp_update_topic_voice_count( $destination_topic_id ); 
  18.  
  19. do_action( 'bbp_split_topic_count', $from_reply_id, $source_topic_id, $destination_topic_id );