diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
index c83e743..7f76462 100644
|
|
|
function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
|
| 186 | 186 | if ( empty( $group_name ) || empty( $group_desc ) ) |
| 187 | 187 | return false; |
| 188 | 188 | |
| 189 | | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
| | 189 | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
| | 190 | $old_group = clone $group; |
| | 191 | |
| 190 | 192 | $group->name = $group_name; |
| 191 | 193 | $group->description = $group_desc; |
| 192 | 194 | |
| … |
… |
function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
|
| 194 | 196 | return false; |
| 195 | 197 | |
| 196 | 198 | if ( $notify_members ) { |
| 197 | | groups_notification_group_updated( $group->id ); |
| | 199 | groups_notification_group_updated( $group->id, $old_group ); |
| 198 | 200 | } |
| 199 | 201 | |
| 200 | 202 | do_action( 'groups_details_updated', $group->id ); |
diff --git src/bp-groups/bp-groups-notifications.php src/bp-groups/bp-groups-notifications.php
index c4b1a48..587cca0 100644
|
|
|
if ( !defined( 'ABSPATH' ) ) exit;
|
| 21 | 21 | * @since BuddyPress (1.0.0) |
| 22 | 22 | * |
| 23 | 23 | * @param int $group_id ID of the group. |
| | 24 | * @param BP_Groups_Group $old_group Group before new details were saved. |
| 24 | 25 | */ |
| 25 | | function groups_notification_group_updated( $group_id = 0 ) { |
| | 26 | function groups_notification_group_updated( $group_id = 0, $old_group = null ) { |
| | 27 | |
| | 28 | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
| | 29 | |
| | 30 | if ( is_a( $old_group, 'BP_Groups_Group' ) ) { |
| | 31 | $changed = array(); |
| | 32 | |
| | 33 | if ( $group->name !== $old_group->name ) { |
| | 34 | $changed[] = sprintf( |
| | 35 | __( '* Name changed from "%s" to "%s"', 'buddypress' ), |
| | 36 | $old_group->name, |
| | 37 | $group->name |
| | 38 | ); |
| | 39 | } |
| | 40 | |
| | 41 | if ( $group->description !== $old_group->description ) { |
| | 42 | $changed[] = sprintf( |
| | 43 | __( '* Description changed from "%s" to "%s"', 'buddypress' ), |
| | 44 | $old_group->description, |
| | 45 | $group->description |
| | 46 | ); |
| | 47 | } |
| | 48 | } |
| | 49 | |
| | 50 | $changed_text = ''; |
| | 51 | if ( ! empty( $changed ) ) { |
| | 52 | $changed_text = "\n\n" . implode( "\n", $changed ); |
| | 53 | } |
| 26 | 54 | |
| 27 | | $group = groups_get_group( array( 'group_id' => $group_id ) ); |
| 28 | 55 | $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) ); |
| 29 | 56 | $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); |
| 30 | 57 | |
| … |
… |
function groups_notification_group_updated( $group_id = 0 ) {
|
| 45 | 72 | $settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/'; |
| 46 | 73 | |
| 47 | 74 | $message = sprintf( __( |
| 48 | | 'Group details for the group "%1$s" were updated: |
| | 75 | 'Group details for the group "%1$s" were updated: %2$s |
| 49 | 76 | |
| 50 | | To view the group: %2$s |
| | 77 | To view the group: %3$s |
| 51 | 78 | |
| 52 | 79 | --------------------- |
| 53 | | ', 'buddypress' ), $group->name, $group_link ); |
| | 80 | ', 'buddypress' ), $group->name, $changed_text, $group_link ); |
| 54 | 81 | |
| 55 | 82 | $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); |
| 56 | 83 | |