Skip to content

Instantly share code, notes, and snippets.

@boonebgorges
boonebgorges / gist:2638943
Created May 8, 2012 20:13
Limit a bp_has_groups() loop to groups matching a groupmeta key/value pair
<?php
/**
* This is a quick and dirty class to work around the fact that bp_has_groups() does not have a
* meta_query parameter (or even an 'in' parameter). Usage:
*
* 1) Just before you fire up your bp_has_groups() loop, instantiate the BP_Groups_Meta_Filter
* class, with parameters $key and $value
* 2) Do your groups loop as normal
* 3) When you've closed the bp_has_groups() loop (endif;), call the method remove_filters() just