Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/29/2024 04:51:33 PM (15 months ago)
Author:
johnjamesjacoby
Message:

Forums: bail out of pre_get_posts if empty post_type parameter

This change addresses a regression inside of bbp_pre_get_posts_normalize_forum_visibility that was unintentionally targeting posts queries that were not sourced from the ones built into bbPress (forum/topic/reply), causing the majority of non-bbPress queries to return empty results.

Fixes #3601.

In branches/2.6, for 2.6.11.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/forums/functions.php

    r7262 r7272  
    23172317    $post_types = array_filter( (array) $posts_query->get( 'post_type' ) );
    23182318
     2319    // Bail if no post types to normalize
     2320    if ( empty( $post_types ) ) {
     2321        return;
     2322    }
     2323
    23192324    // Forums
    23202325    if ( in_array( bbp_get_forum_post_type(), $post_types, true ) ) {
     
    23422347    }
    23432348
    2344     // Some other post type besides Forums, Topics, or Replies
     2349    // Any bbPress post type
    23452350    if ( ! array_diff( $post_types, bbp_get_post_types() ) ) {
    23462351
Note: See TracChangeset for help on using the changeset viewer.