Skip to:
Content

bbPress.org

Changeset 4987


Ignore:
Timestamp:
06/21/2013 04:45:44 PM (8 years ago)
Author:
johnjamesjacoby
Message:

When super sticky topics exist in private or hidden forums, they currently always appear in topic-index listings, even when the current user cannot access them.

This changeset adds 'post_parentnot_in' to the super-sticky post query parameters, to exclude topics that are within private/hidden forums the current user cannot access. Fixes #2173.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/topics/template-tags.php

    r4985 r4987  
    233233                unset( $stickies );
    234234
     235                // Conditionally exclude private/hidden forum ID's
     236                $exclude_forum_ids = bbp_exclude_forum_ids( 'array' );
     237                if ( ! empty( $exclude_forum_ids ) ) {
     238                    $sticky_query['post_parent__not_in'] = $exclude_forum_ids;
     239                }
     240
    235241                // What are the default allowed statuses (based on user caps)
    236242                if ( bbp_get_view_all() ) {
Note: See TracChangeset for help on using the changeset viewer.