#3221 closed defect (bug) (fixed)
Non-bbpress pages marked as forum-archive bbpress
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | |
| Cc: |
Description
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 ) )
In 6864: