Changeset 11309
- Timestamp:
- 12/19/2016 10:40:38 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-functions.php
r11308 r11309 37 37 * @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'. 38 38 * } 39 * @return int|bool ID of the message thread on success, false on failure. 39 * 40 * @return int|bool|WP_Error ID of the message thread on success, false on failure. 40 41 */ 41 42 function messages_new_message( $args = '' ) { … … 57 58 if ( empty( $r['sender_id'] ) ) { 58 59 $error_code = 'messages_empty_sender'; 59 $feedback = __( 'Your message was not sent. Please use a valid sender.', 'buddypress' );60 $feedback = __( 'Your message was not sent. Please use a valid sender.', 'buddypress' ); 60 61 } else { 61 62 $error_code = 'messages_empty_content'; 62 $feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' );63 $feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' ); 63 64 } 64 65 … … 114 115 115 116 // Setup the recipients array. 116 $recipient_ids 117 $recipient_ids = array(); 117 118 118 119 // Invalid recipients are added to an array, for future enhancements. … … 120 121 121 122 // Loop the recipients and convert all usernames to user_ids where needed. 122 foreach ( (array) $r['recipients'] as $recipient ) {123 foreach ( (array) $r['recipients'] as $recipient ) { 123 124 124 125 // Trim spaces and skip if empty. … … 169 170 170 171 // Format this to match existing recipients. 171 foreach ( (array) $recipient_ids as $i => $recipient_id ) {172 $message->recipients[ $i] = new stdClass;173 $message->recipients[ $i]->user_id = $recipient_id;172 foreach ( (array) $recipient_ids as $i => $recipient_id ) { 173 $message->recipients[ $i ] = new stdClass; 174 $message->recipients[ $i ]->user_id = $recipient_id; 174 175 } 175 176 }
Note: See TracChangeset
for help on using the changeset viewer.