Skip to:
Content

bbPress.org


Ignore:
Timestamp:
10/10/2011 05:09:36 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Check query name in bbp_is_single_view(). Fixes #1651. Props GautamGupta for original patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bbp-includes/bbp-common-template.php

    r3505 r3541  
    480480 * @since bbPress (r2789)
    481481 *
    482  * @uses WP_Query Checks if WP_Query::bbp_is_view is true
     482 * @global WP_Query $wp_query To check if WP_Query::bbp_is_view is true
     483 * @uses bbp_get_query_name() To get the query name
    483484 * @return bool Is it a view page?
    484485 */
     
    486487    global $wp_query;
    487488
     489    // Assume false
     490    $retval = false;
     491
     492    // Check query
    488493    if ( !empty( $wp_query->bbp_is_view ) && ( true == $wp_query->bbp_is_view ) )
    489         return true;
    490 
    491     return false;
     494        $retval = true;
     495
     496    // Check query name
     497    if ( empty( $retval ) && bbp_is_query_name( 'bbp_single_view' ) )
     498        $retval = true;
     499
     500    return (bool) apply_filters( 'bbp_is_single_view', $retval );
    492501}
    493502
Note: See TracChangeset for help on using the changeset viewer.