Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/29/2014 04:04:42 PM (9 years ago)
Author:
boonebgorges
Message:

Create an activity item when a group's details are updated.

When a name or description alone are updated, the activity item will display
the "from" and "to" values as part of the formatted activity action string. If
both items have been changed, the activity action will read "x changed the name
and description of the group y".

Fixes #5880.

File:
1 edited

Legend:

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

    r9152 r9204  
    191191        return false;
    192192
    193     $group              = groups_get_group( array( 'group_id' => $group_id ) );
     193    $group     = groups_get_group( array( 'group_id' => $group_id ) );
     194    $old_group = clone $group;
     195
    194196    $group->name        = $group_name;
    195197    $group->description = $group_desc;
     
    202204    }
    203205
    204     do_action( 'groups_details_updated', $group->id );
     206    /**
     207     * Fired after a group's details are updated.
     208     *
     209     * @since BuddyPress (2.2.0)
     210     *
     211     * @param int             $value          ID of the group.
     212     * @param BP_Groups_Group $old_group      Group object, before being modified.
     213     * @param bool            $notify_members Whether to send an email notification to members about the change.
     214     */
     215    do_action( 'groups_details_updated', $group->id, $old_group, $notify_members );
    205216
    206217    return true;
Note: See TracChangeset for help on using the changeset viewer.