Changeset 9226
- Timestamp:
- 12/10/2014 03:50:08 PM (10 years ago)
- Location:
- trunk/src/bp-groups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r9204 r9226 201 201 202 202 if ( $notify_members ) { 203 groups_notification_group_updated( $group->id );203 groups_notification_group_updated( $group->id, $old_group ); 204 204 } 205 205 -
trunk/src/bp-groups/bp-groups-notifications.php
r9170 r9226 22 22 * 23 23 * @param int $group_id ID of the group. 24 */ 25 function groups_notification_group_updated( $group_id = 0 ) { 26 27 $group = groups_get_group( array( 'group_id' => $group_id ) ); 24 * @param BP_Groups_Group $old_group Group before new details were saved. 25 */ 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 ( $old_group instanceof BP_Groups_Group ) { 31 $changed = array(); 32 33 if ( $group->name !== $old_group->name ) { 34 $changed[] = sprintf( 35 _x( '* Name changed from "%s" to "%s"', 'Group update email text', 'buddypress' ), 36 esc_html( $old_group->name ), 37 esc_html( $group->name ) 38 ); 39 } 40 41 if ( $group->description !== $old_group->description ) { 42 $changed[] = sprintf( 43 __( '* Description changed from "%s" to "%s"', 'Group update email text', 'buddypress' ), 44 esc_html( $old_group->description ), 45 esc_html( $group->description ) 46 ); 47 } 48 } 49 50 /** 51 * Filters the bullet points listing updated items in the email notification after a group is updated. 52 * 53 * @since BuddyPress (2.2.0) 54 * 55 * @param array $changed Array of bullet points. 56 */ 57 $changed = apply_filters( 'groups_notification_group_update_updated_items', $changed ); 58 59 $changed_text = ''; 60 if ( ! empty( $changed ) ) { 61 $changed_text = "\n\n" . implode( "\n", $changed ); 62 } 63 28 64 $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) ); 29 65 $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); … … 46 82 47 83 $message = sprintf( __( 48 'Group details for the group "%1$s" were updated: 49 50 To view the group: % 2$s84 'Group details for the group "%1$s" were updated: %2$s 85 86 To view the group: %3$s 51 87 52 88 --------------------- 53 ', 'buddypress' ), $group->name, $ group_link );89 ', 'buddypress' ), $group->name, $changed_text, $group_link ); 54 90 55 91 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
Note: See TracChangeset
for help on using the changeset viewer.