Opened 10 years ago
Closed 10 years ago
#6158 closed enhancement (fixed)
allow removing membership activity from the criteria for marking a group "recently active"
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | has-patch |
Cc: | jon.reeve@… |
Description
Groups will get marked as recently active when they've had membership changes, but some users might not consider those types of activities notable as recent activities. On our BP install, we have lots of group membership changes, especially from new users, and that floods the list of recently active groups, thereby obscuring more significant activity like forum posts. We'd like to use our Recently Active Groups widget to highlight groups with lots of significant activity, not just membership changes.
One solution might be to remove the call to groups_update_groupmeta
from the function groups_join_group
, and to add the already-existing function 'groups_update_last_activity there, like this:
add_action( 'groups_join_group', 'groups_update_last_activity' );. That way, users that want to prevent group membership activities from marking groups as active will be able to remove that action, like they're already able to do with
groups_leave_group,
groups_created_group`, etc.
Unless there's a reason groups_join_group
handles updating this metadata with groups_update_groupmeta
, instead of calling groups_update_last_activity
?
I'll see if I can add a patch for this.
Attachments (2)
Change History (11)
#4
@
10 years ago
- Keywords needs-patch added; close removed
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
Update: Apologies for not reading the ticket thoroughly. I see what you mean now in groups_join_group()
and groups_create_group()
functions.
You want to move the groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() )
function call so it is hookable similar to groups_update_last_activity()
.
We can definitely do this.
#6
@
10 years ago
Above is a patch that hooks groups_update_last_activity
into the action groups_join_group
, instead of manually calling groups_update_groupmeta
.
#7
@
10 years ago
- Milestone changed from Future Release to 2.3
- Owner set to r-a-y
- Status changed from new to assigned
Thanks jreeve.
#8
@
10 years ago
- Keywords has-patch added
02.patch
refreshes Jonathan's initial patch and removes the 'last_activity'
update meta call in groups_create_group()
as the 'last_activity'
timestamp is already updated on the 'groups_created_group'
hook (this merges in the report in #6164 by Jonathan as well):
https://buddypress.trac.wordpress.org/browser/tags/2.2.3.1/src/bp-groups/bp-groups-functions.php#L170
https://buddypress.trac.wordpress.org/browser/tags/2.2.3.1/src/bp-groups/bp-groups-activity.php?marks=375#L355
I would say this is custom functionality based on your site's needs.
You should be able to delete the last activity groupmeta when a new group is created or when a member joins a group on the
'groups_create_group'
and `'groups_join_group' hooks.