Changeset 2077 for trunk/bp-xprofile/bp-xprofile-notifications.php
- Timestamp:
- 11/02/2009 07:54:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-notifications.php
r1905 r2077 6 6 * Records a notification for a new profile wire post to the database and sends out a notification 7 7 * email if the user has this setting enabled. 8 * 8 * 9 9 * @package BuddyPress XProfile 10 10 * @param $wire_post_id The ID of the wire post … … 21 21 function xprofile_record_wire_post_notification( $wire_post_id, $user_id, $poster_id ) { 22 22 global $bp, $current_user; 23 23 24 24 if ( $bp->current_component == $bp->wire->slug && !bp_is_home() ) { 25 25 bp_core_add_notification( $poster_id, $user_id, 'xprofile', 'new_wire_post' ); … … 29 29 $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true ); 30 30 $ud = get_userdata( $user_id ); 31 31 32 32 $wire_link = bp_core_get_user_domain( $user_id ) . 'wire'; 33 33 $settings_link = bp_core_get_user_domain( $user_id ) . 'settings/notifications'; 34 34 35 35 // Set up and send the message 36 36 $to = $ud->user_email; 37 37 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) ); 38 38 39 $message = sprintf( __( 39 $message = sprintf( __( 40 40 '%s posted on your wire: 41 41 … … 48 48 49 49 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 50 50 51 51 // Send it 52 52 wp_mail( $to, $subject, $message ); 53 53 } 54 54 } 55 55 56 56 } 57 57 add_action( 'bp_wire_post_posted', 'xprofile_record_wire_post_notification', 10, 3 );
Note: See TracChangeset
for help on using the changeset viewer.