Skip to:
Content

BuddyPress.org

Ticket #7999: 7999.diff

File 7999.diff, 4.8 KB (added by Mamaduka, 21 months ago)
  • src/bp-members/bp-members-functions.php

    diff --git src/bp-members/bp-members-functions.php src/bp-members/bp-members-functions.php
    index 85d02d62a..bb235add1 100644
    add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 ); 
    9393 *                                             `$member_type` takes precedence over this parameter.
    9494 *     @type array|string $member_type__not_in Array or comma-separated string of member types to be excluded.
    9595 *     @type mixed        $include             Limit results by user IDs. Default: false.
     96 *     @type mixed        $user_ids            IDs corresponding to the users. Default: false.
    9697 *     @type int          $per_page            Results per page. Default: 20.
    9798 *     @type int          $page                Page of results. Default: 1.
    9899 *     @type bool         $populate_extras     Fetch optional extras. Default: true.
    function bp_core_get_users( $args = '' ) { 
    114115                'member_type__in'     => '',
    115116                'member_type__not_in' => '',
    116117                'include'             => false,        // Pass comma separated list of user_ids to limit to only these users.
     118                'user_ids'            => false,
    117119                'per_page'            => 20,           // The number of results to return per page.
    118120                'page'                => 1,            // The page to return if limiting per page.
    119121                'populate_extras'     => true,         // Fetch the last active, where the user is a friend, total friend count, latest update.
  • src/bp-members/bp-members-template.php

    diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
    index 29b1982f3..313d12659 100644
    function bp_activate_slug() { 
    309309 *     @type array|int|string|bool $exclude             Exclude users from results by ID. Accepts an array, a single
    310310 *                                                      integer, a comma-separated list of IDs, or false (to disable
    311311 *                                                      this limiting). Default: false.
     312 *     @type array|string|bool     $user_ids            An array or comma-separated list of IDs, or false (to
     313 *                                                      disable this limiting). Default: false.
    312314 *     @type int                   $user_id             If provided, results are limited to the friends of the specified
    313315 *                                                      user. When on a user's Friends page, defaults to the ID of the
    314316 *                                                      displayed user. Otherwise defaults to 0.
    function bp_has_members( $args = '' ) { 
    368370
    369371                'include'             => false,    // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users.
    370372                'exclude'             => false,    // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users.
     373                'user_ids'            => false,
    371374
    372375                'user_id'             => $user_id, // Pass a user_id to only show friends of this user.
    373376                'member_type'         => $member_type,
  • src/bp-members/classes/class-bp-core-members-template.php

    diff --git src/bp-members/classes/class-bp-core-members-template.php src/bp-members/classes/class-bp-core-members-template.php
    index 735664e20..2dd14d811 100644
    class BP_Core_Members_Template { 
    162162                        'include'             => false,
    163163                        'populate_extras'     => true,
    164164                        'exclude'             => false,
     165                        'user_ids'            => false,
    165166                        'meta_key'            => false,
    166167                        'meta_value'          => false,
    167168                        'page_arg'            => 'upage',
    class BP_Core_Members_Template { 
    180181                if ( !empty( $_REQUEST['letter'] ) ) {
    181182                        $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude );
    182183                } else {
    183                         $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'member_type' => $member_type, 'member_type__in' => $member_type__in, 'member_type__not_in' => $member_type__not_in ) );
     184                        $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'user_ids' => $user_ids, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'member_type' => $member_type, 'member_type__in' => $member_type__in, 'member_type__not_in' => $member_type__not_in ) );
    184185                }
    185186
    186187                if ( !$max || $max >= (int) $this->members['total'] ) {