bbp_get_forum_last_reply_id

Return the forums last reply id.

Description

(int) bbp_get_forum_last_reply_id( (int) $forum_id = 0 ); 

Returns (int)

Forum's last reply id

Parameters (1)

0. $forum_id — Optional. (int)
Forum id

Usage

  1. if ( !function_exists( 'bbp_get_forum_last_reply_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/forums/template.php'; 
  3.  
  4. // Optional. Forum id 
  5. $forum_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_forum_last_reply_id($forum_id); 
  9.  

Defined (1)

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

/includes/forums/template.php  
  1. function bbp_get_forum_last_reply_id( $forum_id = 0 ) { 
  2. $forum_id = bbp_get_forum_id( $forum_id ); 
  3. $reply_id = get_post_meta( $forum_id, '_bbp_last_reply_id', true ); 
  4.  
  5. if ( empty( $reply_id ) ) 
  6. $reply_id = bbp_get_forum_last_topic_id( $forum_id ); 
  7.  
  8. return (int) apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id );