Skip to:
Content

bbPress.org

Changeset 5608


Ignore:
Timestamp:
01/30/2015 05:16:17 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Prevent notices and warnings when template stack is empty. Fixes #2749.

Location:
trunk/src/includes/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/template-functions.php

    r5466 r5608  
    314314        // Add 'bbp_template_stack' to the current filter array
    315315        $wp_current_filter[] = $tag;
     316
     317        // Bail if no stack setup
     318        if ( empty( $wp_filter[ $tag ] ) ) {
     319                return array();
     320        }
    316321
    317322        // Sort
  • trunk/src/includes/core/theme-compat.php

    r5470 r5608  
    101101        }
    102102
    103         // Set the active theme compat theme
    104         $bbp->theme_compat->theme = $bbp->theme_compat->packages[$theme];
     103        // Try to set the active theme compat theme. If it's not in the registered
     104        // packages array, it doesn't exist, so do nothing with it.
     105        if ( isset( $bbp->theme_compat->packages[$theme] ) ) {
     106                $bbp->theme_compat->theme = $bbp->theme_compat->packages[$theme];
     107        }
    105108}
    106109
Note: See TracChangeset for help on using the changeset viewer.