Skip to:
Content

bbPress.org

Changeset 3362


Ignore:
Timestamp:
07/14/2011 01:38:56 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Set the post_type to topic in bbp_pre_get_posts() when viewing a topic tag. Fixes issue where topics of tag were not visible in some installations. Fixes #1547. Props cnorris23.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-compatibility.php

    r3348 r3362  
    2929 *
    3030 * @global bbPress $bbp
    31  * @param string $theme 
     31 * @param string $theme
    3232 * @uses current_theme_supports()
    3333 */
    3434function bbp_theme_compat_set_theme( $theme = array() ) {
    35    
     35
    3636    // Check if current theme supports bbPress
    3737    if ( empty( $bbp->theme_compat->theme ) && !current_theme_supports( 'bbpress' ) ) {
     
    4040
    4141        if ( empty( $theme ) ) {
    42             $theme = array( 
     42            $theme = array(
    4343                'dir' => $bbp->themes_dir . '/bbp-twentyten',
    4444                'url' => $bbp->themes_url . '/bbp-twentyten'
     
    201201function bbp_set_theme_compat_templates( $templates = array() ) {
    202202    global $bbp;
    203    
     203
    204204    $bbp->theme_compat->templates = $templates;
    205    
     205
    206206    return $bbp->theme_compat->templates;
    207207}
     
    219219function bbp_set_theme_compat_template( $template = '' ) {
    220220    global $bbp;
    221    
     221
    222222    $bbp->theme_compat->template = $template;
    223    
     223
    224224    return $bbp->theme_compat->template;
    225225}
     
    290290    $wp_query->is_archive = false;
    291291    $wp_query->is_tax     = false;
    292    
     292
    293293    // If we are resetting a post, we are in theme compat
    294294    bbp_set_theme_compat_active();
     
    600600    $templates = apply_filters( 'bbp_get_reply_edit_template', $templates );
    601601    $templates = bbp_set_theme_compat_templates( $templates );
    602    
     602
    603603    $template  = locate_template( $templates, false, false );
    604604    $template  = bbp_set_theme_compat_template( $template );
     
    974974        // Forum archive
    975975        } elseif ( bbp_is_forum_archive() ) {
    976            
     976
    977977            // Page exists where this archive should be
    978978            if ( $page = bbp_get_page_by_path( $bbp->root_slug ) ) {
     
    12191219 */
    12201220function bbp_get_page_by_path( $path = '' ) {
    1221    
     1221
    12221222    // Default to false
    12231223    $retval = false;
     
    15041504        // We save post revisions on our own
    15051505        remove_action( 'pre_post_update', 'wp_save_post_revision' );
     1506
     1507    // Topic tag page
     1508    } elseif ( bbp_is_topic_tag() ) {
     1509        $posts_query->query_vars['post_type'] = bbp_get_topic_post_type();
    15061510    }
    15071511
Note: See TracChangeset for help on using the changeset viewer.