bbp_get_forum_last_reply_id

  • apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id )

    Source Reference:

    • Component: bbPress :: bbp-forum
      File: /bbp-includes/bbp-forum-template.php :: Trac Source Line: 876
      	 * @return int Forum's last reply id
      	 */
      	function bbp_get_forum_last_reply_id( $forum_id = 0 ) {
      		$forum_id = bbp_get_forum_id( $forum_id );
      		$reply_id = get_post_meta( $forum_id, '_bbp_last_reply_id', true );
      
      		if ( empty( $reply_id ) )
      			$reply_id = bbp_get_forum_last_topic_id( $forum_id );
      
      		return apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id );
      	}
      
      /**
       * Output the title of the last reply inside a forum
       *
       * @param int $forum_id Optional. Forum id
       * @uses bbp_get_forum_last_reply_title() To get the forum's last reply's title
       */
      function bbp_forum_last_reply_title( $forum_id = 0 ) {
      	echo bbp_get_forum_last_reply_title( $forum_id );
      
    • Component: bbPress :: bbp-forum
      File: /bbp-includes/bbp-forum-functions.php :: Trac Source Line: 1039
      		if ( empty( $topic_ids ) )
      			$topic_ids = bbp_forum_query_topic_ids( $forum_id );
      
      		if ( !empty( $topic_ids ) && ( $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ) ) )
      			wp_cache_set( $cache_id, $reply_id, 'bbpress' );
      		else
      			wp_cache_set( $cache_id, '0', 'bbpress' );
      	}
      
      	return apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id );
      }
      
      /** Listeners *****************************************************************/
      
      /**
       * Check if it's a hidden forum or a topic or reply of a hidden forum and if
       * the user can't view it, then sets a 404
       *
       * @since bbPress (r2996)
       *
      

Comments are closed.