Skip to:
Content

bbPress.org

Ticket #1574: 1574.001.diff

File 1574.001.diff, 2.3 KB (added by cnorris23, 15 years ago)
  • bbp-includes/bbp-core-compatibility.php

     
    2828 * @since bbPress (r3311)
    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' ) ) {
    3838
    3939                global $bbp;
    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'
    4545                        );
     
    200200 */
    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}
    208208
     
    218218 */
    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}
    226226
     
    289289        $wp_query->is_single  = false;
    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();
    295295}
     
    599599
    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 );
    605605
     
    973973
    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 ) ) {
    979979
     
    12181218 * @return mixed False if no page, Page object if true
    12191219 */
    12201220function bbp_get_page_by_path( $path = '' ) {
    1221        
     1221
    12221222        // Default to false
    12231223        $retval = false;
    12241224
     
    15031503
    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
    15081512        return $posts_query;