Skip to:
Content

BuddyPress.org

Changeset 9815


Ignore:
Timestamp:
04/28/2015 03:50:50 PM (11 years ago)
Author:
r-a-y
Message:

Groups: Streamline last activity update meta calls.

This commit:

  • Removes the hardcoded 'last_activity' call in groups_join_group() and uses the groups_update_last_activity() on the 'groups_join_group' hook. This mirrors last activity update calls on other group actions (leave, created).
  • Removes the hardcoded 'last_activity' call in groups_create_group(). The last activity is already updated on the 'groups_created_group' hook. No need to update twice!

Props jreeve.

Fixes #6158.

Location:
trunk/src/bp-groups
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-activity.php

    r9450 r9815  
    401401        groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    402402}
     403add_action( 'groups_join_group',           'groups_update_last_activity' );
    403404add_action( 'groups_leave_group',          'groups_update_last_activity' );
    404405add_action( 'groups_created_group',        'groups_update_last_activity' );
  • trunk/src/bp-groups/bp-groups-functions.php

    r9811 r9815  
    166166                $member->save();
    167167
    168                 groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
    169 
    170168                /**
    171169                 * Fires after the creation of a new group and a group creator needs to be made.
     
    194192
    195193        /**
    196          * Fires after the creation of a group.
     194         * Fires after the creation or update of a group.
    197195         *
    198196         * @since BuddyPress (1.0.0)
     
    501499                'user_id' => $user_id,
    502500        ) );
    503 
    504         // Modify group meta
    505         groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
    506501
    507502        /**
Note: See TracChangeset for help on using the changeset viewer.