Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/12/2021 02:09:02 PM (3 years ago)
Author:
imath
Message:

Support date queries for Members, Groups and Sites

According to components, date queries can be restricted to a limited list of loop types:

  • For Members, the $type parameter in bp_has_members() needs to be either active, newest, random or online.
  • For Groups, the $type parameter in bp_has_groups() needs to be either active or newest.
  • For sites, the $type parameter in bp_has_blogs() needs to be either active or newest.

Props r-a-y

Fixes #8488

File:
1 edited

Legend:

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

    r13166 r13184  
    310310 * @since 1.2.0
    311311 * @since 7.0.0 Added `xprofile_query` parameter. Added `user_ids` parameter.
     312 * @since 10.0.0 Added `date_query` parameter.
    312313 *
    313314 * @global BP_Core_Members_Template $members_template
     
    357358 *     @type array                 $xprofile_query      Filter results by xprofile data. Requires the xprofile
    358359 *                                                      component. See {@see BP_XProfile_Query} for details.
     360 *     @type array                 $date_query          Filter results by member last activity date. See first parameter of
     361 *                                                      {@link WP_Date_Query::__construct()} for syntax. Only applicable if
     362 *                                                      $type is either 'active', 'random', 'newest', or 'online'.
    359363 *     @type bool                  $populate_extras     Whether to fetch optional data, such as friend counts.
    360364 *                                                      Default: true.
     
    414418
    415419            'xprofile_query'      => false,
     420            'date_query'          => false,    // Filter members by last activity.
    416421            'populate_extras'     => true,     // Fetch usermeta? Friend count, last active etc.
    417422        ),
Note: See TracChangeset for help on using the changeset viewer.