Changeset 9153
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-notifications.php
r8169 r9153 137 137 $link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends' ); 138 138 139 // $action and $amount are used to generate dynamic filter names. 140 $action = 'accepted'; 141 139 142 // Set up the string and the filter 140 143 if ( (int) $total_items > 1 ) { 141 144 $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items ); 142 $ filter = 'bp_friends_multiple_friendship_accepted_notification';145 $amount = 'multiple'; 143 146 } else { 144 147 $text = sprintf( __( '%s accepted your friendship request', 'buddypress' ), bp_core_get_user_displayname( $item_id ) ); 145 $ filter = 'bp_friends_single_friendship_accepted_notification';148 $amount = 'single'; 146 149 } 147 150 … … 150 153 case 'friendship_request': 151 154 $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/?new'; 155 156 $action = 'request'; 152 157 153 158 // Set up the string and the filter 154 159 if ( (int) $total_items > 1 ) { 155 160 $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items ); 156 $ filter = 'bp_friends_multiple_friendship_request_notification';161 $amount = 'multiple'; 157 162 } else { 158 163 $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';164 $amount = 'single'; 160 165 } 161 166 … … 165 170 // Return either an HTML link or an array, depending on the requested format 166 171 if ( 'string' == $format ) { 167 $return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id );172 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id ); 168 173 } else { 169 $return = apply_filters( $filter, array(174 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', array( 170 175 'link' => $link, 171 176 'text' => $text
Note: See TracChangeset
for help on using the changeset viewer.