Title: [Plugin: bbPress Threaded Replies] PHP error
Last modified: August 20, 2016

---

# [Plugin: bbPress Threaded Replies] PHP error

 *  Resolved [briantoronto](https://wordpress.org/support/users/briantoronto/)
 * (@briantoronto)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/)
 * Hi
 * I am getting the following error:
    `Warning: Invalid argument supplied for foreach()
   in /home/accnews/public_html/thecommunity/wp-content/plugins/bbpress-threaded-
   replies/bbpress-threaded-replies.php on line 128` I am running WP 3.4.1 with 
   bbPress 2.1.2 using PHP 5.2.14 It is on my dev site, so nothing is broken in 
   production, but any advice would be very helpful.
 * Thanks,
 * Brian
 * [http://wordpress.org/extend/plugins/bbpress-threaded-replies/](http://wordpress.org/extend/plugins/bbpress-threaded-replies/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [andrea.ressell](https://wordpress.org/support/users/andrearessell/)
 * (@andrearessell)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2955977)
 * Brian, I’ve got the same problem. Please post if you find a solution.
    Thanks
   Andrea
 *  [onomoney](https://wordpress.org/support/users/onomoney/)
 * (@onomoney)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2956041)
 * I have the same issue after posting a video. public_html/wp-content/plugins/bbpress-
   threaded-replies/bbpress-threaded-replies.php on line 128
    Here is where it is
   located [http://spraytanit.com/forums/topic/wordpress-settings-writing/](http://spraytanit.com/forums/topic/wordpress-settings-writing/)
 * I just shut the threaded replies plugin off and everything works fine.
 *  [induthotla](https://wordpress.org/support/users/induthotla/)
 * (@induthotla)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2956042)
 * add the if condition to check whether array is empty or not like
    if (is_array(
   $posts)){ foreach( $posts as $post ) { // Ignore the topic if included. if ( 
   bbp_get_reply_post_type() == $post->post_type ) { $in_reply_to = get_post_meta(
   $post->ID, ‘_ucc_btr_in_reply_to’, true ); if ( empty( $in_reply_to ) || ( bbp_get_reply_topic_id(
   $post->ID ) == $in_reply_to ) ) $in_reply_to = 0; $post->in_reply_to = $in_reply_to;
   $replies[] = $post; } elseif ( bbp_get_topic_post_type() == $post->post_type ){
   delete_post_meta( $post->ID, ‘_ucc_btr_in_reply_to’ ); } }}
 *  [onomoney](https://wordpress.org/support/users/onomoney/)
 * (@onomoney)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2956043)
 * Very cool and thanks.
    Where do we add it to? /bbpress-threaded-replies.php on
   line 128 maybe!
 *  Plugin Author [Jennifer M. Dodd](https://wordpress.org/support/users/jmdodd/)
 * (@jmdodd)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2956055)
 * This issue should be resolved in the latest version. Please let me know if it
   fixes this error.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: bbPress Threaded Replies] PHP error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bbpress-threaded-replies.svg)
 * [bbPress Threaded Replies](https://wordpress.org/plugins/bbpress-threaded-replies/)
 * [Support Threads](https://wordpress.org/support/plugin/bbpress-threaded-replies/)
 * [Active Topics](https://wordpress.org/support/plugin/bbpress-threaded-replies/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbpress-threaded-replies/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbpress-threaded-replies/reviews/)

## Tags

 * [PHPError](https://wordpress.org/support/topic-tag/phperror/)

 * 5 replies
 * 5 participants
 * Last reply from: [Jennifer M. Dodd](https://wordpress.org/support/users/jmdodd/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-bbpress-threaded-replies-php-error/#post-2956055)
 * Status: resolved