Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/12/2021 02:09:02 PM (4 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-functions.php

    r13108 r13184  
    914914 * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters.
    915915 * @since 2.7.0 Added `$update_admin_cache` and `$parent_id` parameters.
     916 * @since 10.0.0 Added `$date_query` parameter.
    916917 *
    917918 * @param array|string $args {
     
    943944            'group_type__not_in' => '',             // Array or comma-separated list of group types that will be excluded from results.
    944945            'meta_query'         => false,          // Filter by groupmeta. See WP_Meta_Query for syntax.
     946            'date_query'         => false,          // Filter by group last activity date. See WP_Date_Query for syntax.
    945947            'show_hidden'        => false,          // Show hidden groups to non-admins.
    946948            'status'             => array(),        // Array or comma-separated list of group statuses to limit results to.
     
    967969        'group_type__not_in' => $r['group_type__not_in'],
    968970        'meta_query'         => $r['meta_query'],
     971        'date_query'         => $r['date_query'],
    969972        'show_hidden'        => $r['show_hidden'],
    970973        'status'             => $r['status'],
Note: See TracChangeset for help on using the changeset viewer.