bp_messages_recipients

  • apply_filters( 'bp_messages_recipients', $recipients )

    Source Reference:

    • Component: BuddyPress :: bp-messages
      File: /bp-messages/bp-messages-screens.php :: Trac Source Line: 69
      					bp_core_redirect( $bp->loggedin_user->domain . $bp->messages->slug . '/inbox/' );
      				} else {
      					bp_core_add_message( __( 'There was an error sending that notice, please try again', 'buddypress' ), 'error' );
      				}
      			} else {
      				// Filter recipients into the format we need - array( 'username/userid', 'username/userid' )
      				$autocomplete_recipients = explode( ',', $_POST['send-to-input'] );
      				$typed_recipients        = explode( ' ', $_POST['send_to_usernames'] );
      				$recipients              = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients );
      				$recipients              = apply_filters( 'bp_messages_recipients', $recipients );
      
      				// Send the message
      				if ( $thread_id = messages_new_message( array( 'recipients' => $recipients, 'subject' => $_POST['subject'], 'content' => $_POST['content'] ) ) ) {
      					bp_core_add_message( __( 'Message sent successfully!', 'buddypress' ) );
      					bp_core_redirect( $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $thread_id . '/' );
      				} else {
      					bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
      				}
      			}
      		}
      

Comments are closed.