Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2015 02:07:44 AM (10 years ago)
Author:
tw2113
Message:

More docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-notifications.php

    r10147 r10323  
    2424 * @param int $initiator_id  ID of the user who initiated the request.
    2525 * @param int $friend_id     ID of the request recipient.
    26  *
    2726 * @return bool
    2827 */
     
    4039    $initiator_link    = bp_core_get_user_domain( $initiator_id );
    4140
    42     // Set up and send the message
     41    // Set up and send the message.
    4342    $to       = $ud->user_email;
    4443    $subject  = bp_get_email_subject( array( 'text' => sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ) ) );
     
    5352', 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_link );
    5453
    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.
    5655    if ( bp_is_active( 'settings' ) ) {
    5756        $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    116115 * @param int $initiator_id  ID of the user who initiated the request.
    117116 * @param int $friend_id     ID of the request recipient.
    118  *
    119117 * @return bool
    120118 */
     
    131129    $settings_link = trailingslashit( bp_core_get_user_domain( $initiator_id ) . $settings_slug . '/notifications' );
    132130
    133     // Set up and send the message
     131    // Set up and send the message.
    134132    $to       = $ud->user_email;
    135133    $subject  = bp_get_email_subject( array( 'text' => sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ) ) );
     
    142140', 'buddypress' ), $friend_name, $friend_name, $friend_link );
    143141
    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.
    145143    if ( bp_is_active( 'settings' ) ) {
    146144        $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    207205 * @param string $format            'string' for BuddyBar-compatible notifications;
    208206 *                                  'array' for WP Toolbar. Default: 'string'.
    209  *
    210207 * @return array|string
    211208 */
     
    219216            $action = 'accepted';
    220217
    221             // Set up the string and the filter
     218            // Set up the string and the filter.
    222219            if ( (int) $total_items > 1 ) {
    223220                $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items );
     
    235232            $action = 'request';
    236233
    237             // Set up the string and the filter
     234            // Set up the string and the filter.
    238235            if ( (int) $total_items > 1 ) {
    239236                $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items );
     
    247244    }
    248245
    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.
    250247    if ( 'string' == $format ) {
    251248
     
    332329 *
    333330 * @since 1.9.0
     331 *
    334332 * @param int $friendship_id     The unique ID of the friendship.
    335333 * @param int $initiator_user_id The friendship initiator user ID.
     
    356354 * @since 1.9.0
    357355 *
    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.
    360358 */
    361359function bp_friends_mark_friendship_rejected_notifications_by_item_id( $friendship_id, $friendship ) {
     
    377375function bp_friends_add_friendship_accepted_notification( $friendship_id, $initiator_user_id, $friend_user_id ) {
    378376
    379     // Bail if notifications is not active
     377    // Bail if notifications is not active.
    380378    if ( ! bp_is_active( 'notifications' ) ) {
    381379        return;
    382380    }
    383381
    384     // Remove the friend request notice
     382    // Remove the friend request notice.
    385383    bp_notifications_mark_notifications_by_item_id( $friend_user_id, $initiator_user_id, buddypress()->friends->id, 'friendship_request' );
    386384
    387     // Add a friend accepted notice for the initiating user
     385    // Add a friend accepted notice for the initiating user.
    388386    bp_notifications_add_notification(  array(
    389387        'user_id'           => $initiator_user_id,
     
    403401 * @since 1.9.0
    404402 *
    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.
    407405 */
    408406function bp_friends_mark_friendship_withdrawn_notifications_by_item_id( $friendship_id, $friendship ) {
     
    418416 * @since 1.9.0
    419417 *
    420  * @param int $user_id
     418 * @param int $user_id ID of the user whose notifications are removed.
    421419 */
    422420function bp_friends_remove_notifications_data( $user_id = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.