[buddypress-trac] [BuddyPress Trac] #6094: Support custom group statuses
buddypress-trac
noreply at wordpress.org
Thu Jan 8 13:22:58 UTC 2015
#6094: Support custom group statuses
-------------------------+-------------------------------
Reporter: Offereins | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Groups | Version: 2.1
Severity: normal | Keywords: reporter-feedback
-------------------------+-------------------------------
Currently there does not seem to be any plan for a Group Status API, but
the set of filters already in place to add custom group statuses, is
incomplete. Most importantly, the list of statuses for the Privacy option
on the Create Group or Edit Group screens cannot be changed dynamically.
=== Current extendable logic ===
I found the following filters to be present in {{{bp-groups}}}:
'''/bp-groups-admin.php'''
{{{groups_allowed_status}}} filter in {{{bp_groups_admin_load()}}}
{{{bp_groups_list_table_get_views}}} action in
{{{BP_Groups_List_Table::get_views()}}}; only for adding views
{{{bp_groups_admin_get_group_status}}} filter in
{{{BP_Groups_List_Table::column_status()}}}
'''/bp-groups-functions.php'''
{{{groups_is_valid_status()}}} checks component global {{{valid_status}}};
used only once in BuddyPress
'''/bp-groups-loader.php'''
{{{groups_valid_status}}} filter in
{{{BP_Groups_Component::setup_globals()}}}
'''/bp-groups-screen.php'''
{{{groups_allowed_status}}} filter in
{{{groups_screen_group_admin_settings()}}}
'''/bp-groups-template.php'''
{{{bp_get_group_type}}} filter in {{{bp_get_group_type()}}}; missing
{{{$group}}} argument!
=== Current hardcoded logic ===
Within {{{bp-groups}}} the following locations contain hardcoded
references to the various group statuses:
'''/bp-groups-actions.php'''
in {{{groups_action_create_group()}}} - new group status
'''/bp-groups-activity.php'''
in {{{groups_record_activity()}}} - hide_sitewide activity arg based on
'public' status
'''/bp-groups-admin.php'''
in {{{BP_Groups_List_Table::get_views()}}} - group views
in {{{bp_groups_admin_edit_metabox_settings()}}} - Privacy selector
'''/bp-groups-classes.php'''
in {{{BP_Groups_Group::populate()}}} - {{{user_has_access}}} prop based on
status
in {{{BP_Groups_Group::get()}}} - there is no {{{status}}} arg in the
groups query
in {{{BP_Groups_Group::get_global_topic_count()}}} - counts by status
in {{{BP_Groups_Group::get_group_type_ids()}}} - ids by status
'''/bp-groups-template.php'''
in {{{bp_group_is_visible()}}} - no filter
'''/bp-templates/bp-legacys'''
in {{{groups/create.php}}}: Privacy selector
in {{{groups/single/admin.php}}}: Privacy selector
=== Approach ===
In {{{bp-groups-admin.php}}} a {{{@todo}}} states that the group status
label [https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups
/bp-groups-admin.php#L1452 "should be abstracted out somewhere for the
whole Groups component"]. Perhaps we can try to move this, along with all
other status details, into a single place and have all current filters and
other non-filtered locations use the set of statuses as a reference.
Closely tied to the group statuses are group visibility and user access.
In many cases the {{{hidden}}} status is hardcoded to be added to or
removed from group (count) queries. Whether this should be looked into as
well, I'm not sure.
Would this approach be worth the effort?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6094>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list