Changeset 3166
- Timestamp:
- 08/09/2010 08:33:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-messages.php
r3157 r3166 155 155 messages_remove_callback_values(); 156 156 157 / * Check if the message form has been submitted */157 // Check if the message form has been submitted 158 158 if ( isset( $_POST['send'] ) ) { 159 159 160 / * Check the nonce */160 // Check the nonce 161 161 check_admin_referer( 'messages_send_message' ); 162 162 163 / * Check we have what we need */163 // Check we have what we need 164 164 if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) { 165 165 bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' ); 166 166 } else { 167 / * If this is a notice, send it */167 // If this is a notice, send it 168 168 if ( isset( $_POST['send-notice'] ) ) { 169 169 if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) { … … 174 174 } 175 175 } else { 176 / * Filter recipients into the format we need - array( 'username/userid', 'username/userid' ) */176 // Filter recipients into the format we need - array( 'username/userid', 'username/userid' ) 177 177 $autocomplete_recipients = explode( ',', $_POST['send-to-input'] ); 178 $typed_recipients = explode( ' ', $_POST['send_to_usernames'] ); 179 $recipients = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients ); 180 181 /* Send the message */ 178 $typed_recipients = explode( ' ', $_POST['send_to_usernames'] ); 179 $recipients = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients ); 180 $recipients = apply_filters( 'bp_messages_recipients', $recipients ); 181 182 // Send the message 182 183 if ( $thread_id = messages_new_message( array( 'recipients' => $recipients, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) ) { 183 184 bp_core_add_message( __( 'Message sent successfully!', 'buddypress' ) ); … … 188 189 } 189 190 } 190 191 191 } 192 192
Note: See TracChangeset
for help on using the changeset viewer.