Skip to:
Content

bbPress.org

Ticket #3334: 3334.01.patch

File 3334.01.patch, 725 bytes (added by r-a-y, 4 years ago)
  • src/includes/common/template.php

     
    11011101 * @return bool In a bbPress page
    11021102 */
    11031103function is_bbpress() {
     1104        global $wp_query;
    11041105
    11051106        // Defalt to false
    11061107        $retval = false;
    11071108
     1109        // Main query must be set before using this function.
     1110        if ( ! isset( $wp_query ) ) {
     1111                _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.', 'bbpress' ), '2.7.0' );
     1112                return false;
     1113        }
     1114
    11081115        /** Archives **************************************************************/
    11091116
    11101117        if ( bbp_is_forum_archive() ) {