bbPress breaks WP_Query in certain cases
I’ve stumbled across that problem today. Let’s say I make a forum of ID 65 private in bbPress’ settings.
Then, somewhere in my template I’m using get_posts to pull some custom post type content which has nothing to do with the forums. When there is no user with sufficient privileges logged in, bbPress adds following SQL to my query:
... INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) ...
... AND ( ( wp_postmeta.meta_key = '_bbp_forum_id' AND CAST(wp_postmeta.meta_value AS SIGNED) != '65' ) ) ...
which always ends up breaking my query, since the posts I’m querying for do not have meta_key entries of ‘_bbp_forum_id’.
I’ve switched the plugin off temporarily, but that doesn’t solve the problem for good.
- You must be logged in to reply to this topic.