current_component == $bp->wire->slug && !bp_is_home() ) { bp_core_add_notification( $poster_id, $user_id, 'xprofile', 'new_wire_post' ); if ( !get_usermeta( $user_id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $user_id, 'notification_profile_wire_post' ) ) { $poster_name = bp_core_get_user_displayname( $poster_id ); $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true ); $ud = get_userdata( $user_id ); $wire_link = bp_core_get_user_domain( $user_id ) . 'wire'; $settings_link = bp_core_get_user_domain( $user_id ) . 'settings/notifications'; // Set up and send the message $to = $ud->user_email; $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) ); $message = sprintf( __( '%s posted on your wire: "%s" To view your wire: %s --------------------- ', 'buddypress' ), $poster_name, stripslashes($wire_post->content), $wire_link ); $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); // Send it wp_mail( $to, $subject, $message ); } } } add_action( 'bp_wire_post_posted', 'xprofile_record_wire_post_notification', 10, 3 ); ?>