Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/15/2016 02:21:54 AM (9 years ago)
Author:
boonebgorges
Message:

Introduce Group Types API.

Modeled on the Member Types API, Group Types allow developers to register
arbitrary group categorizations, and assign one or more of these types to a
given group. BuddyPress stores this information in a custom taxonomy on the
root blog.

Group queries can be filtered by group type, by using the group_type,
group_type__in, and group_type__not_in parameters in the bp_has_groups()
template loop function stack.

Props Mamaduka, boonebgorges, dcavins.
See #6784.

File:
1 edited

Legend:

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

    r10721 r10766  
    103103 *
    104104 * @since 1.0.0
     105 * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters.
    105106 *
    106107 * @param array|string $args {
     
    140141 *                                           `$_REQUEST['groups_search']` or
    141142 *                                           `$_REQUEST['s']`, if present. Otherwise false.
     143 *     @type array|string $group_type         Array or comma-separated list of group types to limit results to.
     144 *     @type array|string $group_type__in     Array or comma-separated list of group types to limit results to.
     145 *     @type array|string $group_type__not_in Array or comma-separated list of group types that will be
     146 *                                            excluded from results.
    142147 *     @type array        $meta_query        An array of meta_query conditions.
    143148 *                                           See {@link WP_Meta_Query::queries} for description.
     
    207212        'slug'              => $slug,
    208213        'search_terms'      => $search_terms,
     214        'group_type'         => '',
     215        'group_type__in'     => '',
     216        'group_type__not_in' => '',
    209217        'meta_query'        => false,
    210218        'include'           => false,
     
    227235        'slug'              => $r['slug'],
    228236        'search_terms'      => $r['search_terms'],
     237        'group_type'         => $r['group_type'],
     238        'group_type__in'     => $r['group_type__in'],
     239        'group_type__not_in' => $r['group_type__not_in'],
    229240        'meta_query'        => $r['meta_query'],
    230241        'include'           => $r['include'],
Note: See TracChangeset for help on using the changeset viewer.