Skip to:
Content

bbPress.org

Changeset 5211


Ignore:
Timestamp:
11/29/2013 03:27:50 PM (8 years ago)
Author:
johnjamesjacoby
Message:

In bbp_has_forums() do some post_parent routing to make sure all forums are available on subscription pages. Fixes #2480. (2.5 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/forums/template.php

    r5165 r5211  
    115115function bbp_has_forums( $args = '' ) {
    116116
     117    // Forum archive only shows root
     118    if ( bbp_is_forum_archive() ) {
     119        $default_post_parent = 0;
     120
     121    // User subscriptions shows any
     122    } elseif ( bbp_is_subscriptions() ) {
     123        $default_post_parent = 'any';
     124
     125    // Could be anything, so look for possible parent ID
     126    } else {
     127        $default_post_parent = bbp_get_forum_id();
     128    }
     129
    117130    // Parse arguments with default forum query for most circumstances
    118131    $bbp_f = bbp_parse_args( $args, array(
    119132        'post_type'           => bbp_get_forum_post_type(),
    120         'post_parent'         => bbp_is_forum_archive() ? 0 : bbp_get_forum_id(),
     133        'post_parent'         => $default_post_parent,
    121134        'post_status'         => bbp_get_public_status_id(),
    122135        'posts_per_page'      => get_option( '_bbp_forums_per_page', 50 ),
Note: See TracChangeset for help on using the changeset viewer.