Skip to:
Content

bbPress.org

Changeset 3384


Ignore:
Timestamp:
08/07/2011 02:11:44 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Add bbp_is_topic_tag() to is_bbpress() check. Fixes #1581. Props sorich87.

File:
1 edited

Legend:

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

    r3382 r3384  
    6464 *
    6565 * @since bbPress (r3251)
    66  * 
     66 *
    6767 * @uses is_post_type_archive() To check if we are looking at the forum archive
    6868 * @uses bbp_get_forum_post_type() To get the forum post type ID
     
    7171 */
    7272function bbp_is_forum_archive() {
    73    
     73
    7474    // Default to false
    7575    $retval = false;
     
    7878    if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) )
    7979        $retval = true;
    80    
     80
    8181    return (bool) apply_filters( 'bbp_is_forum_archive', $retval );
    8282}
     
    158158 *
    159159 * @since bbPress (r3251)
    160  * 
     160 *
    161161 * @uses is_post_type_archive() To check if we are looking at the topic archive
    162162 * @uses bbp_get_topic_post_type() To get the topic post type ID
     
    172172    if ( is_post_type_archive( bbp_get_topic_post_type() ) || bbp_is_query_name( 'bbp_topic_archive' ) )
    173173        $retval = true;
    174    
     174
    175175    return (bool) apply_filters( 'bbp_is_topic_archive', $retval );
    176176}
     
    231231 *
    232232 * @global bbPress $bbp
    233  * @return bool True if it's a topic tag, false if not 
     233 * @return bool True if it's a topic tag, false if not
    234234 */
    235235function bbp_is_topic_tag() {
     
    502502    if ( bbp_is_forum_archive() )
    503503        $bbp_classes[] = bbp_get_forum_post_type() . '-archive';
    504    
     504
    505505    if ( bbp_is_topic_archive() )
    506506        $bbp_classes[] = bbp_get_topic_post_type() . '-archive';
    507    
     507
    508508    /** Components ************************************************************/
    509509
     
    618618
    619619    elseif ( bbp_is_topic_archive() )
     620        $retval = true;
     621
     622    elseif ( bbp_is_topic_tag() )
    620623        $retval = true;
    621624
     
    10901093
    10911094        <?php
    1092        
     1095
    10931096        wp_nonce_field( 'bbp-new-reply' );
    10941097
     
    10991102
    11001103        <?php endif;
    1101            
     1104
    11021105    }
    11031106}
     
    14011404        // No custom home text
    14021405        if ( empty( $args['home_text'] ) ) {
    1403            
     1406
    14041407            // Set home text to page title
    14051408            if ( $front_id = get_option( 'page_on_front' ) ) {
    14061409                $pre_front_text = get_the_title( $front_id );
    1407                
     1410
    14081411            // Default to 'Home'
    14091412            } else {
     
    14211424            $pre_root_text = bbp_get_forum_archive_title();
    14221425        }
    1423        
     1426
    14241427        /** Includes **********************************************************/
    14251428
     
    14371440
    14381441        /** Current Text ******************************************************/
    1439        
     1442
    14401443        // Forum archive
    14411444        if ( bbp_is_forum_archive() )
     
    14971500            'current_text'    => $pre_current_text
    14981501        );
    1499         $r = apply_filters( 'bbp_get_breadcrumb_pre', wp_parse_args( $args, $defaults ) );     
     1502        $r = apply_filters( 'bbp_get_breadcrumb_pre', wp_parse_args( $args, $defaults ) );
    15001503        extract( $r );
    15011504
     
    15121515        // Do we want to include a link to the forum root?
    15131516        if ( !empty( $include_root ) || empty( $root_text ) ) {
    1514            
     1517
    15151518            // Page exists at root slug path, so use its permalink
    15161519            if ( $page = bbp_get_page_by_path( $bbp->root_slug ) ) {
    15171520                $root_url = get_permalink( $page->ID );
    1518                
     1521
    15191522            // Use the root slug
    15201523            } else {
     
    17831786        if ( bbp_is_user_home() ) {
    17841787            $title = __( 'Your Profile', 'bbpress' );
    1785            
     1788
    17861789        // Other users profile
    17871790        } else {
     
    17961799        if ( bbp_is_user_home() ) {
    17971800            $title = __( 'Edit Your Profile', 'bbpress' );
    1798            
     1801
    17991802        // Other users profile
    18001803        } else {
Note: See TracChangeset for help on using the changeset viewer.