Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/13/2014 11:53:30 PM (12 years ago)
Author:
netweb
Message:

Remove pre_get_posts action bbp_pre_get_posts_normalize_forum_visibility from forum visibility repair tool to prevent hidden and private post status injected into WP_Query. Props thebrandonallen. Fixes #2512

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/forums/functions.php

    r5171 r5257  
    930930    delete_option( '_bbp_private_forums' );
    931931    delete_option( '_bbp_hidden_forums'  );
     932   
     933    /**
     934     * Don't search for both private/hidden statuses. Since 'pre_get_posts' is an
     935     * action, it's not removed by suppress_filters. We need to make sure that
     936     * we're only searching for the supplied post_status.
     937     *
     938     * @see https://bbpress.trac.wordpress.org/ticket/2512
     939     */
     940    remove_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', 4 );
    932941
    933942    // Next, get all the private and hidden forums
     
    946955        'fields'           => 'ids'
    947956    ) );
     957   
     958    // Enable forum visibilty normalization
     959    add_action( 'pre_get_posts', 'bbp_pre_get_posts_normalize_forum_visibility', 4 );
    948960
    949961    // Reset the $post global
Note: See TracChangeset for help on using the changeset viewer.