#5456 closed enhancement (fixed)
Filter bp_has_groups query args
Reported by: | Offereins | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.0 | Priority: | normal |
Severity: | normal | Version: | 1.9.2 |
Component: | Groups | Keywords: | |
Cc: |
Description
Currently there is no convenient way to prevent bp_has_groups()
from using $_GET['s']
for querying groups matching search terms. Bypassing this behavior would be great for use cases where the groups query is not the primary page query and thus should ignore the search parameters, possibly among others.
Suggested is to add a filter before sending the query args to BP_Groups_Template()
.
See http://buddypress.org/support/topic/use-bp_has_groups-without-search-parameter/.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Adding a filter to the arguments is a pretty general solution to this specific issue. The problem is that
bp_has_groups()
is a bully about the 'search_terms' argument: it overrides values passed to the function, in favor of those found in the URL parameters. Let's correct this issue before adding general filters.So, in brief, you can ensure that search params won't apply like this: