Changeset 9175
- Timestamp:
- 11/25/2014 03:00:37 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-friends/bp-friends-notifications.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-notifications.php
r9153 r9175 57 57 } 58 58 59 // Send the message 59 /** 60 * Filters the email address for who is getting the friend request. 61 * 62 * @since BuddyPress (1.2.0) 63 * 64 * @param string $to Email address for who is getting the friend request. 65 */ 60 66 $to = apply_filters( 'friends_notification_new_request_to', $to ); 67 68 /** 69 * Filters the subject for the friend request email. 70 * 71 * @since BuddyPress (1.2.0) 72 * 73 * @param string $subject Subject line to be used in friend request email. 74 * @param string $initiator_name Name of the person requesting friendship. 75 */ 61 76 $subject = apply_filters( 'friends_notification_new_request_subject', $subject, $initiator_name ); 77 78 /** 79 * Filters the message for the friend request email. 80 * 81 * @since BuddyPress (1.2.0) 82 * 83 * @param string $message Message to be used in friend request email. 84 * @param string $initiator_name Name of the person requesting friendship. 85 * @param string $initiator_link Profile link of person requesting friendship. 86 * @param string $all_requests_link User's friends request management link. 87 * @param string $settings_link Email recipient's settings management link. 88 */ 62 89 $message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link, $settings_link ); 63 90 64 91 wp_mail( $to, $subject, $message ); 65 92 93 /** 94 * Fires after the new friend request email is sent. 95 * 96 * @since BuddyPress (1.5.0) 97 * 98 * @param int $friend_id ID of the request recipient. 99 * @param string $subject Text for the friend request subject field. 100 * @param string $message Text for the friend request message field. 101 * @param int $friendship_id ID of the friendship object. 102 * @param int $initiator_id ID of the friendship requester. 103 */ 66 104 do_action( 'bp_friends_sent_request_email', $friend_id, $subject, $message, $friendship_id, $initiator_id ); 67 105 } … … 106 144 } 107 145 108 // Send the message 146 /** 147 * Filters the email address for whose friend request got accepted. 148 * 149 * @since BuddyPress (1.2.0) 150 * 151 * @param string $to Email address for whose friend request got accepted. 152 */ 109 153 $to = apply_filters( 'friends_notification_accepted_request_to', $to ); 154 155 /** 156 * Filters the subject for the friend request accepted email. 157 * 158 * @since BuddyPress (1.2.0) 159 * 160 * @param string $subject Subject line to be used in friend request accepted email. 161 * @param string $friend_name Name of the person who accepted the friendship request. 162 */ 110 163 $subject = apply_filters( 'friends_notification_accepted_request_subject', $subject, $friend_name ); 164 165 /** 166 * Filters the message for the friend request accepted email. 167 * 168 * @since BuddyPress (1.2.0) 169 * 170 * @param string $message Message to be used in friend request email. 171 * @param string $friend_name Name of the person who accepted the friendship request. 172 * @param string $friend_link Profile link of person who accepted the friendship request. 173 * @param string $settings_link Email recipient's settings management link. 174 */ 111 175 $message = apply_filters( 'friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link ); 112 176 113 177 wp_mail( $to, $subject, $message ); 114 178 179 /** 180 * Fires after the friend request accepted email is sent. 181 * 182 * @since BuddyPress (1.5.0) 183 * 184 * @param int $initiator_id ID of the friendship requester. 185 * @param string $subject Text for the friend request subject field. 186 * @param string $message Text for the friend request message field. 187 * @param int $friendship_id ID of the friendship object. 188 * @param int $friend_id ID of the request recipient. 189 */ 115 190 do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id ); 116 191 } … … 170 245 // Return either an HTML link or an array, depending on the requested format 171 246 if ( 'string' == $format ) { 247 248 /** 249 * Filters the format of friendship notifications based on type and amount * of notifications pending. 250 * 251 * This is a variable filter that has four possible versions. 252 * The four possible versions are: 253 * - bp_friends_single_friendship_accepted_notification 254 * - bp_friends_multiple_friendship_accepted_notification 255 * - bp_friends_single_friendship_request_notification 256 * - bp_friends_multiple_friendship_request_notification 257 * 258 * @since BuddyPress (1.0.0) 259 * 260 * @param string|array $value Depending on format, an HTML link to new requests profile 261 * tab or array with link and text. 262 * @param int $total_items The total number of messaging-related notifications 263 * waiting for the user. 264 * @param int $item_id The primary item ID. 265 */ 172 266 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id ); 173 267 } else { 268 /** This filter is documented in bp-friends/bp-friends-notifications.php */ 174 269 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', array( 175 270 'link' => $link, … … 178 273 } 179 274 275 /** 276 * Fires at the end of the bp-friends notification format callback. 277 * 278 * @since BuddyPress (1.0.0) 279 * 280 * @param string $action The kind of notification being rendered. 281 * @param int $item_id The primary item ID. 282 * @param int $secondary_item_id The secondary item ID. 283 * @param int $total_items The total number of messaging-related notifications 284 * waiting for the user. 285 * @param array|string $return Notification text string or array of link and text. 286 */ 180 287 do_action( 'friends_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return ); 181 288
Note: See TracChangeset
for help on using the changeset viewer.