Skip to:
Content

bbPress.org

Ticket #1801: 0001-patched-bbpress-theme-compat-for-5.4-warning-concern.patch

File 0001-patched-bbpress-theme-compat-for-5.4-warning-concern.patch, 1.3 KB (added by lavoiesl, 14 years ago)
  • bbp-includes/bbp-theme-compatibility.php

    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 b class BBP_Theme_Compat { 
    6666 * @param BBP_Theme_Compat $theme
    6767 */
    6868function bbp_setup_theme_compat( $theme = '' ) {
    69         bbpress()->theme_compat->theme = $theme;
     69        $bbp = bbpress();
     70        if (!is_object($bbp->theme_compat)) {
     71                $bbp->theme_compat = new stdClass;
     72        }
     73        $bbp->theme_compat->theme = $theme;
    7074}
    7175
    7276/**
    function bbp_theme_compat_reset_post( $args = array() ) { 
    246250        unset( $post            );
    247251
    248252        // Setup the dummy post object
     253        $wp_query->post = new stdClass;
    249254        $wp_query->post->ID             = $dummy['ID'];
    250255        $wp_query->post->post_title     = $dummy['post_title'];
    251256        $wp_query->post->post_author    = $dummy['post_author'];