[buddypress-trac] [BuddyPress] #2377: Create show_hidden argument for bp_has_groups (has patch!)
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Mon May 10 14:35:52 UTC 2010
#2377: Create show_hidden argument for bp_has_groups (has patch!)
--------------------------+-------------------------------------------------
Reporter: boonebgorges | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: 1.2.4
Component: Core | Keywords: has-patch needs-testing
--------------------------+-------------------------------------------------
I'm working on a plugin http://teleogistic.net/code/buddypress/bp-system-
report/ that uses WP's pseudo-cron to take regular snapshots of the BP
installation, but I found that the script wasn't counting hidden groups.
On closer examination, it's because hidden groups are being excluded from
the query on
if ( !is_user_logged_in() || ( !is_site_admin() && ( $user_id !=
$bp->loggedin_user->id ) ) )
That conditional returns false for the automated script, and there's no
way to get around it with filters because it happens immediately before
the query (which seems wrong to me anyway, as all other contextual
arguments are determined outside of bp-groups-classes.php).
The attached patch adds an argument $show_hidden to bp_has_groups.
I'm tagging it 1.2.4 because I'm a bit desperate for a fix :) but I
understand that it's late in the game so it's OK to bump to 1.3 if
necessary.
--
Ticket URL: <https://trac.buddypress.org/ticket/2377>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list