-
get-groups-by-taxonomyGet Groups by Taxonomy -
list-group-taxonomiesList Group Taxonomies -
list-termsList Group Taxonomy Terms
Get Groups by Taxonomy
Finds BuddyPress groups matching one or more taxonomy terms, and returns each matching group with its own term assignments across every taxonomy this plugin manages. For a single taxonomy, supply taxonomy + terms (+ optional field/operator). For multi-taxonomy AND/OR combinations, supply tax_query directly using the same shape as WordPress core’s native tax_query argument (a flat clause, or multiple clauses with a top-level relation key) — when tax_query is supplied, taxonomy/terms/field/operator are ignored. Results can optionally be narrowed to specific group statuses. Requires bp_moderate.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
taxonomy |
string | No | Taxonomy slug to filter by. Required unless tax_query is supplied. |
|
terms |
array of string | No | Term values to match, interpreted per the field parameter (default: slugs). Required unless tax_query is supplied. |
|
field |
string | No | "slug" |
Which field the values in terms refer to. Default slug. One of: slug, term_id, name, term_taxonomy_id. |
operator |
string | No | "IN" |
How terms are matched. Default IN (group has any of the given terms). One of: IN, NOT IN, AND, EXISTS, NOT EXISTS. |
tax_query |
array of object | No | Advanced: a WP_Tax_Query-shaped array of clauses (each with taxonomy/terms/field/operator), optionally combined with a top-level “relation” key (“AND” or “OR”) for multi-taxonomy queries. Overrides taxonomy/terms/field/operator when supplied. | |
status |
array of string | No | Optional. Only return groups with one of these statuses. Omit to return groups of any status. | |
per_page |
integer | No | 20 |
Results per page. Default 20, max 100. |
page |
integer | No | 1 |
Page number (1-based). Default 1. |
List Group Taxonomies
Lists the taxonomies this plugin currently manages against BuddyPress groups (i.e. those added to the lh_bp_group_taxonomies_taxonomies filter by a companion plugin). This plugin does not register taxonomies itself, so this list may be empty if no companion plugin has hooked in. Use the returned taxonomy slugs with list-terms and get-groups-by-taxonomy. Requires bp_moderate.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
_ |
string | No | Unused. This ability takes no parameters. |
List Group Taxonomy Terms
Lists the terms for a single taxonomy managed by this plugin, with each term’s group count. Use list-group-taxonomies first to discover valid taxonomy slugs. Requires bp_moderate.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
taxonomy |
string | Yes | Taxonomy slug, as returned by list-group-taxonomies. | |
hide_empty |
boolean | No | false |
If true, only return terms currently assigned to at least one group. Default false. |
