Skip to main content

add_participant_to_thread

Adding user to existing conversation

REQUIREMENTS

To be able to implement this guide, you need to learn how to insert PHP snippets to your website.

You can find guide here: WP Beginner

<?php
// Returns array of user ids (int), returns empty array if no participants or thread not exists
$user_id = 3;
$thread_id = 6610;


// Returns true if user was added or false if user was not added
$user_added = Better_Messages()->functions->add_participant_to_thread( $thread_id, $user_id );