Skip to:

#3221 closed defect (fixed)

Non-bbpress pages marked as forum-archive bbpress

Reported by: scmsteve Owned by: johnjamesjacoby
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords:


Looks like it was after commit [6672] that this snuck in.

We have our forum set up with "Forum root should show" as "Topics by last post".

We have it set up this way becuase we have a custom page defined showing topics on top with the forums list on the bottom, and without doing this the pagination of topics gave 404 errors after the 2nd page (my assumption is becuase it assumes it is paginating forums not topics) But that is a side point.

Various custom-post pages had their display loop break, and I saw the body was classed with "forum-archive bbpress" even though they weren't bbpress pages.

It looks like commit [6672] made changes to includes/core/template-functions.php as to how it was determing to mark pages.

This part of the test:

is_post_type_archive( get_post_types( array( 'source' => 'bbpress', 'has_archive' ) ) )

Always returns true becuase this part:

get_post_types( array( 'source' => 'bbpress', 'has_archive' ) )

Returns an empty array here. This causes any page that uses any custom post type (like our WooCommerce product pages/etc) to be treated as a bbpress archive page.

If I change it to this it seems to work as expected:

get_post_types( array( 'source' => 'bbpress', 'has_archive' => true ) )

Change History (3)

#1 @johnjamesjacoby
12 months ago

In 6864:

General: update bbp_get_post_types() to accept arguments to parse before calling get_post_types().

This avoids other manual calls to get_post_types() in other places. See #3221.

#2 @johnjamesjacoby
12 months ago

  • Milestone changed from Awaiting Review to 2.7
  • Owner set to johnjamesjacoby

#3 @johnjamesjacoby
12 months ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6865:

Templates: call bbp_get_post_types() when parsing query args and setting template args.

Fixes #3221. Props scmsteve.

Note: See TracTickets for help on using tickets.