$thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ); // Send the reply. if ( ! empty( $new_reply ) ) { bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) ); } else { bp_core_add_message( __( 'There was a problem sending your reply. Please try again.', 'buddypress' ), 'error' ); } bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' ); } /* * Mark message read, but only run on the logged-in user's profile. * If an admin visits a thread, it shouldn't change the read status. */ if ( bp_is_my_profile() ) { messages_mark_thread_read( $thread_id ); } /** * Fires after processing a view request for a single message thread. * * @since 1.7.0 */ do_action( 'messages_action_conversation' ); } add_action( 'bp_actions', 'messages_action_conversation' );