Reply To: Anyone else not able to see original post?

#148341
Spidermint WANTED $103
Sheriff

Thanks mrsdoyle.

Firstly, yes I have sorted all the big wins in the new site. Improved popups, gallery etc.
There has been a huge increase in mobile screenshots which the system was never designed for so it has had to be reworked in part to accommodate those better. As you can imagine, ripping all of that out and re-implementing has been a bit of a job.

Regarding the forum issue, and after what seems like days, I have found the issue!
TLDR; It should now be fixed!

If you are not technical or just don’t care what the problem was look away now! 🙂

WordPress in their wisdom decided to introduce a “sort” function into the core wp-query class when multiple post types are present.
“Not a problem”, I hear you say, “nothing wrong with sorting the post type array?” Well, I can only think of one reason for them introducing this and it may be to do with optimising queries at the database level by having the post types sorted…;
Unfortunately they did no consider the slightly maverick coding in the bbpress plugin codebase which doesn’t only check the post types, it does a strict check of the post type order!? Why?… nobody knows!

Below is bbpress’ delightful code check that seems to require them to be in a specific order:

// Bail if not a topic and reply query
if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) !== $query->get( 'post_type' ) ) {
    return $where;
}

Simple fix, right? Well.. sort of. As I cannot alter the WordPress code or the BBpress code I had to add a new filter to intercept the query before this function to switch the post type order back! Dirty!

Don’t get me wrong, BBpress is great but ooo (shakes fist)

If you are still reading, thanks for listening.

Cheers

1