Changeset 12124 for trunk/src/bp-groups/bp-groups-functions.php
- Timestamp:
- 05/25/2018 05:08:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r11922 r12124 604 604 return true; 605 605 } 606 607 /** 608 * Update the last_activity meta value for a given group. 609 * 610 * @since 1.0.0 611 * 612 * @param int $group_id Optional. The ID of the group whose last_activity is 613 * being updated. Default: the current group's ID. 614 * @return false|null False on failure. 615 */ 616 function groups_update_last_activity( $group_id = 0 ) { 617 618 if ( empty( $group_id ) ) { 619 $group_id = buddypress()->groups->current_group->id; 620 } 621 622 if ( empty( $group_id ) ) { 623 return false; 624 } 625 626 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 627 } 628 add_action( 'groups_join_group', 'groups_update_last_activity' ); 629 add_action( 'groups_leave_group', 'groups_update_last_activity' ); 630 add_action( 'groups_created_group', 'groups_update_last_activity' ); 606 631 607 632 /** General Group Functions ***************************************************/
Note: See TracChangeset
for help on using the changeset viewer.