From b50b363ff51880fafd08e402a77779de7cac7b7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Lavoie?= <seb@wemakecustom.com>
Date: Fri, 30 Mar 2012 12:55:53 -0400
Subject: [PATCH] patched bbpress theme compat for 5.4 warning concerning
 object not initialized

---
 .../bbp-includes/bbp-theme-compatibility.php       |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bbp-includes/bbp-theme-compatibility.php b/bbp-includes/bbp-theme-compatibility.php
index d572afa..bcdc56e 100644
--- a/bbp-includes/bbp-theme-compatibility.php
+++ b/bbp-includes/bbp-theme-compatibility.php
@@ -66,7 +66,11 @@ class BBP_Theme_Compat {
  * @param BBP_Theme_Compat $theme
  */
 function bbp_setup_theme_compat( $theme = '' ) {
-	bbpress()->theme_compat->theme = $theme;
+	$bbp = bbpress();
+	if (!is_object($bbp->theme_compat)) {
+		$bbp->theme_compat = new stdClass;
+	}
+	$bbp->theme_compat->theme = $theme;
 }
 
 /**
@@ -246,6 +250,7 @@ function bbp_theme_compat_reset_post( $args = array() ) {
 	unset( $post            );
 
 	// Setup the dummy post object
+	$wp_query->post = new stdClass;
 	$wp_query->post->ID             = $dummy['ID'];
 	$wp_query->post->post_title     = $dummy['post_title'];
 	$wp_query->post->post_author    = $dummy['post_author'];
-- 
1.7.9.4

