Ticket #5970: bp-friends-notifications-5970.diff
File bp-friends-notifications-5970.diff, 2.3 KB (added by , 10 years ago) |
---|
-
src/bp-friends/bp-friends-notifications.php
136 136 case 'friendship_accepted': 137 137 $link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends' ); 138 138 139 $action = 'accepted'; 140 139 141 // Set up the string and the filter 140 142 if ( (int) $total_items > 1 ) { 141 143 $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items ); 142 $ filter = 'bp_friends_multiple_friendship_accepted_notification';144 $amount = 'multiple'; 143 145 } else { 144 146 $text = sprintf( __( '%s accepted your friendship request', 'buddypress' ), bp_core_get_user_displayname( $item_id ) ); 145 $ filter = 'bp_friends_single_friendship_accepted_notification';147 $amount = 'single'; 146 148 } 147 149 148 150 break; … … 150 152 case 'friendship_request': 151 153 $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/?new'; 152 154 155 $action = 'request'; 156 153 157 // Set up the string and the filter 154 158 if ( (int) $total_items > 1 ) { 155 159 $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items ); 156 $ filter = 'bp_friends_multiple_friendship_request_notification';160 $amount = 'multiple'; 157 161 } else { 158 162 $text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) ); 159 $ filter = 'bp_friends_single_friendship_request_notification';163 $amount = 'single'; 160 164 } 161 165 162 166 break; … … 164 168 165 169 // Return either an HTML link or an array, depending on the requested format 166 170 if ( 'string' == $format ) { 167 $return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id );171 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id ); 168 172 } else { 169 $return = apply_filters( $filter, array(173 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', array( 170 174 'link' => $link, 171 175 'text' => $text 172 176 ), (int) $total_items, $item_id );