Changeset 12124
- Timestamp:
- 05/25/2018 05:08:27 PM (7 years ago)
- Location:
- trunk/src/bp-groups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r11959 r12124 428 428 429 429 /** 430 * Update the last_activity meta value for a given group.431 *432 * @since 1.0.0433 *434 * @param int $group_id Optional. The ID of the group whose last_activity is435 * being updated. Default: the current group's ID.436 * @return false|null False on failure.437 */438 function groups_update_last_activity( $group_id = 0 ) {439 440 if ( empty( $group_id ) ) {441 $group_id = buddypress()->groups->current_group->id;442 }443 444 if ( empty( $group_id ) ) {445 return false;446 }447 448 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );449 }450 add_action( 'groups_join_group', 'groups_update_last_activity' );451 add_action( 'groups_leave_group', 'groups_update_last_activity' );452 add_action( 'groups_created_group', 'groups_update_last_activity' );453 454 /**455 430 * Add an activity stream item when a member joins a group. 456 431 * -
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.