Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/26/2013 06:50:47 PM (7 years ago)
Author:
boonebgorges
Message:

Introduces a 'meta_query' parameter for the bp_has_groups() stack

This will allow plugin and theme authors to customize their group directories
based on data stored in the groupmeta table, using a powerful syntax familiar
from WP_Query.

Also adds unit tests for BP_Groups_Group::get() for the meta_query parameter,
as well as an integration test for the entire bp_has_groups() chain of
functions.

Fixes #3521

File:
1 edited

Legend:

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

    r6777 r6950  
    145145            'exclude'         => false,
    146146            'search_terms'    => '',
     147            'meta_query'      => false,
    147148            'populate_extras' => true
    148149        );
     
    170171                'user_id'         => $user_id,
    171172                'search_terms'    => $search_terms,
     173                'meta_query'      => $meta_query,
    172174                'include'         => $include,
    173175                'exclude'         => $exclude,
     
    308310        'slug'            => $slug,    // Pass a group slug to only return that group
    309311        'search_terms'    => '',       // Pass search terms to return only matching groups
     312        'meta_query'      => false,    // Filter by groupmeta. See WP_Meta_Query for format
    310313        'include'         => false,    // Pass comma separated list or array of group ID's to return only these groups
    311314        'exclude'         => false,    // Pass comma separated list or array of group ID's to exclude these groups
     
    335338        'slug'            => $r['slug'],
    336339        'search_terms'    => $r['search_terms'],
     340        'meta_query'      => $r['meta_query'],
    337341        'include'         => $r['include'],
    338342        'exclude'         => $r['exclude'],
Note: See TracChangeset for help on using the changeset viewer.