#7501 closed enhancement (fixed)
Add "status" parameter to groups_get_groups().
Reported by: | dcavins | Owned by: | dcavins |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 1.6 |
Component: | Groups | Keywords: | has-patch |
Cc: | dcavins |
Description
I've been exploring moving toward more granular visibility/access/other properties for groups and a prerequisite is being able to query groups by status or statuses. I think this is a useful improvement to groups_get_groups()
on its own, anyway.
I'm attaching a patch that maintains the current behavior (with the show_hidden
parameter) and adds the ability to directly fetch groups by status. Please let me know if you have concerns.
Attachments (1)
Change History (7)
#3
in reply to:
↑ 2
@
8 years ago
Replying to r-a-y:
Looks good, but not sure why we would want to support multiple group statuses that are delimited by a space. I would probably remove that and just ask for an array from the get-go if one is querying for multiple statuses.
Thanks for your comments, @r-a-y. I was primarily following our other input filtering that is self-defense against a variety of input types, similarly to how we handle the group_type
parameter in groups_get_groups()
, which I think was based on how WP does something similar in W_Query: https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-includes/class-wp-query.php#L1943
In any case, I'm OK with accepting the parameter in whatever format is preferred by the team for consistency internally.
Thanks again for taking a look.
Looks good, but not sure why we would want to support multiple group statuses that are delimited by a space. I would probably remove that and just ask for an array from the get-go if one is querying for multiple statuses.