Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2016 06:21:10 PM (9 years ago)
Author:
dcavins
Message:

Add query support for hierarchical groups.

Adds a new column to the groups table, parent_id, and support for
querying by parent_id via groups_get_groups() and
bp_has_groups().

Does not add any front-facing hierarchy functionality—that is left for
now to plugins.

Props dcavins, boonebgorges, r-a-y, djpaul, mercime.

See #3961.

File:
1 edited

Legend:

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

    r11091 r11095  
    139139 *     @type array|string $exclude            Array or comma-separated list of group IDs. Results will exclude
    140140 *                                            the listed groups. Default: false.
     141 *     @type array|string $parent_id          Array or comma-separated list of group IDs. Results will include only
     142 *                                            child groups of the listed groups. Default: null.
    141143 *     @type bool         $update_meta_cache  Whether to fetch groupmeta for queried groups. Default: true.
    142144 *     @type bool         $update_admin_cache Whether to pre-fetch group admins for queried groups.
     
    203205        'include'            => false,
    204206        'exclude'            => false,
     207        'parent_id'          => null,
    205208        'populate_extras'    => true,
    206209        'update_meta_cache'  => true,
     
    227230        'include'            => $r['include'],
    228231        'exclude'            => $r['exclude'],
     232        'parent_id'          => $r['parent_id'],
    229233        'populate_extras'    => (bool) $r['populate_extras'],
    230234        'update_meta_cache'  => (bool) $r['update_meta_cache'],
Note: See TracChangeset for help on using the changeset viewer.