Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/07/2012 02:14:42 AM (12 years ago)
Author:
boonebgorges
Message:

Introduces BP_User_Query for improved member query performance

  • Introduces BP_User_Query class
  • Deprecates use of BP_Core_User::get_users() in bp_core_get_users(), the main member query function in BuddyPress
  • Introduces bp_use_legacy_user_query filter, to allow plugins to use legacy query method during transition
  • Expands user query functionality to support 'user_ids' parameter, which can be used to skip the user_id query altogether, for maximum flexibility in plugins and themes

Props boonebgorges, johnjamesjacoby.

See #4060

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-widgets.php

    r6264 r6314  
    4040           . $after_title; ?>
    4141
    42         <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
     42        <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
    4343            <div class="item-options" id="members-list-options">
    4444                <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
     
    157157           . $after_title; ?>
    158158
    159         <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
     159        <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
    160160            <div class="avatar-block">
    161161                <?php while ( bp_members() ) : bp_the_member(); ?>
     
    221221           . $after_title; ?>
    222222
    223         <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
     223        <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?>
    224224            <div class="avatar-block">
    225225                <?php while ( bp_members() ) : bp_the_member(); ?>
     
    291291    }
    292292
    293     if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?>
     293    if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=1' ) ) : ?>
    294294        <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
    295295        <div class="avatar-block">
Note: See TracChangeset for help on using the changeset viewer.