Changeset 10323 for trunk/src/bp-friends/bp-friends-notifications.php
- Timestamp:
- 11/02/2015 02:07:44 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-notifications.php
r10147 r10323 24 24 * @param int $initiator_id ID of the user who initiated the request. 25 25 * @param int $friend_id ID of the request recipient. 26 *27 26 * @return bool 28 27 */ … … 40 39 $initiator_link = bp_core_get_user_domain( $initiator_id ); 41 40 42 // Set up and send the message 41 // Set up and send the message. 43 42 $to = $ud->user_email; 44 43 $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ) ) ); … … 53 52 ', 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_link ); 54 53 55 // Only show the disable notifications line if the settings component is enabled 54 // Only show the disable notifications line if the settings component is enabled. 56 55 if ( bp_is_active( 'settings' ) ) { 57 56 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 116 115 * @param int $initiator_id ID of the user who initiated the request. 117 116 * @param int $friend_id ID of the request recipient. 118 *119 117 * @return bool 120 118 */ … … 131 129 $settings_link = trailingslashit( bp_core_get_user_domain( $initiator_id ) . $settings_slug . '/notifications' ); 132 130 133 // Set up and send the message 131 // Set up and send the message. 134 132 $to = $ud->user_email; 135 133 $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ) ) ); … … 142 140 ', 'buddypress' ), $friend_name, $friend_name, $friend_link ); 143 141 144 // Only show the disable notifications line if the settings component is enabled 142 // Only show the disable notifications line if the settings component is enabled. 145 143 if ( bp_is_active( 'settings' ) ) { 146 144 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 207 205 * @param string $format 'string' for BuddyBar-compatible notifications; 208 206 * 'array' for WP Toolbar. Default: 'string'. 209 *210 207 * @return array|string 211 208 */ … … 219 216 $action = 'accepted'; 220 217 221 // Set up the string and the filter 218 // Set up the string and the filter. 222 219 if ( (int) $total_items > 1 ) { 223 220 $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items ); … … 235 232 $action = 'request'; 236 233 237 // Set up the string and the filter 234 // Set up the string and the filter. 238 235 if ( (int) $total_items > 1 ) { 239 236 $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items ); … … 247 244 } 248 245 249 // Return either an HTML link or an array, depending on the requested format 246 // Return either an HTML link or an array, depending on the requested format. 250 247 if ( 'string' == $format ) { 251 248 … … 332 329 * 333 330 * @since 1.9.0 331 * 334 332 * @param int $friendship_id The unique ID of the friendship. 335 333 * @param int $initiator_user_id The friendship initiator user ID. … … 356 354 * @since 1.9.0 357 355 * 358 * @param int $friendship_id (not used)359 * @param object $friendship 356 * @param int $friendship_id Friendship ID (not used). 357 * @param object $friendship Friendship object. 360 358 */ 361 359 function bp_friends_mark_friendship_rejected_notifications_by_item_id( $friendship_id, $friendship ) { … … 377 375 function bp_friends_add_friendship_accepted_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { 378 376 379 // Bail if notifications is not active 377 // Bail if notifications is not active. 380 378 if ( ! bp_is_active( 'notifications' ) ) { 381 379 return; 382 380 } 383 381 384 // Remove the friend request notice 382 // Remove the friend request notice. 385 383 bp_notifications_mark_notifications_by_item_id( $friend_user_id, $initiator_user_id, buddypress()->friends->id, 'friendship_request' ); 386 384 387 // Add a friend accepted notice for the initiating user 385 // Add a friend accepted notice for the initiating user. 388 386 bp_notifications_add_notification( array( 389 387 'user_id' => $initiator_user_id, … … 403 401 * @since 1.9.0 404 402 * 405 * @param int $friendship_id (not used)406 * @param object $friendship 403 * @param int $friendship_id Friendship ID (not used). 404 * @param object $friendship Friendship Object. 407 405 */ 408 406 function bp_friends_mark_friendship_withdrawn_notifications_by_item_id( $friendship_id, $friendship ) { … … 418 416 * @since 1.9.0 419 417 * 420 * @param int $user_id 418 * @param int $user_id ID of the user whose notifications are removed. 421 419 */ 422 420 function bp_friends_remove_notifications_data( $user_id = 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.