Skip to:
Content

BuddyPress.org

Changeset 8574


Ignore:
Timestamp:
07/09/2014 08:16:16 PM (5 years ago)
Author:
boonebgorges
Message:

Only get 'search_terms' out of $_REQUESTs? in bp_group_has_members() if no 'search_terms' param has been passed to the function

This allows secondary, search-free loops to be run on a page, by passing an
empty string to the 'search_terms' param. See #5318 for a similar strategy as
applied to members widgets.

Fixes #5746

Props WCUADD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r8531 r8574  
    22582258 *           'first_joined', or any of the $type params available in
    22592259 *           {@link BP_User_Query}. Default: 'last_joined'.
    2260  *     @type string $search_terms Optional. Search terms to match.
     2260 *     @type string $search_terms Optional. Search terms to match. Pass an
     2261 *           empty string to force-disable search, even in the presence of
     2262 *           $_REQUEST['s']. Default: null.
    22612263 * }
    22622264 */
     
    22792281        'exclude_banned'      => 1,
    22802282        'group_role'          => false,
    2281         'search_terms'        => false,
     2283        'search_terms'        => null,
    22822284        'type'                => 'last_joined',
    22832285    ) );
    22842286
    2285     if ( empty( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) )
     2287    if ( is_null( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) ) {
    22862288        $r['search_terms'] = $_REQUEST['s'];
     2289    }
    22872290
    22882291    $members_template = new BP_Groups_Group_Members_Template( $r );
Note: See TracChangeset for help on using the changeset viewer.