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-groups/bp-groups-template.php

    r13108 r13184  
    363363 * @since 2.7.0 Added `$update_admin_cache` parameter.
    364364 * @since 7.0.0 Added `$status` parameter.
     365 * @since 10.0.0 Added `$date_query` parameter.
    365366 *
    366367 * @param array|string $args {
     
    392393 *     @type array        $meta_query         An array of meta_query conditions.
    393394 *                                            See {@link WP_Meta_Query::queries} for description.
     395 *     @type array        $date_query         Filter results by group last activity date. See first parameter of
     396 *                                            {@link WP_Date_Query::__construct()} for syntax. Only applicable if
     397 *                                            $type is either 'newest' or 'active'.
    394398 *     @type array|string $include            Array or comma-separated list of group IDs. Results will be limited
    395399 *                                            to groups within the list. Default: false.
     
    483487            'status'             => $status,
    484488            'meta_query'         => false,
     489            'date_query'         => false,
    485490            'include'            => false,
    486491            'exclude'            => false,
     
    510515        'status'             => $r['status'],
    511516        'meta_query'         => $r['meta_query'],
     517        'date_query'         => $r['date_query'],
    512518        'include'            => $r['include'],
    513519        'exclude'            => $r['exclude'],
Note: See TracChangeset for help on using the changeset viewer.