Changeset 11306
- Timestamp:
- 12/19/2016 10:24:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-message.php
r11028 r11306 193 193 * 194 194 * @param array $recipient_usernames Usernames of recipients. 195 * @return array $recipient_ids Array of Recepient IDs. 195 * 196 * @return bool|array $recipient_ids Array of Recepient IDs. 196 197 */ 197 198 public static function get_recipient_ids( $recipient_usernames ) { 198 if ( !$recipient_usernames ) 199 return false; 199 $recipient_ids = false; 200 201 if ( ! $recipient_usernames ) { 202 return $recipient_ids; 203 } 200 204 201 205 if ( is_array( $recipient_usernames ) ) { 202 for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) { 203 if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) ) { 206 $rec_un_count = count( $recipient_usernames ); 207 208 for ( $i = 0, $count = $rec_un_count; $i < $count; ++ $i ) { 209 if ( $rid = bp_core_get_userid( trim( $recipient_usernames[ $i ] ) ) ) { 204 210 $recipient_ids[] = $rid; 205 211 } … … 207 213 } 208 214 209 return $recipient_ids; 215 /** 216 * Filters the array of recipients IDs. 217 * 218 * @since 2.8.0 219 * 220 * @param array $recipient_ids Array of recipients IDs that were retrieved based on submitted usernames. 221 * @param array $recipient_usernames Array of recipients usernames that were submitted by a user. 222 */ 223 return apply_filters( 'messages_message_get_recipient_ids', $recipient_ids, $recipient_usernames ); 210 224 } 211 225
Note: See TracChangeset
for help on using the changeset viewer.