Hello Shamim
I need users to be able to send messages to people who are not in his group (ex: a user in Paris send a message to users who are in London). Searching the forum in order to achieve this I saw this topic posted 7 months ago:
https://www.shamimsplugins.com/support/topic/send-message-to-group-not-member-of-that-group/#post-19329
in which you ask us to add following code in our functions.php file:
add_filter( 'fep_get_user_groups', function( $user_groups, $user_id ){
$groups = fep_get_option('gm_groups', array());
if( $groups && is_array( $groups) ){
foreach ( $groups as $group ) {
$user_groups[ $group['slug'] ] = $group['name'];
}
}
return $user_groups;
}, 10, 2);
It is working (meaning the user can send a message to another group), but as a result, once the message is sent, the user is now part of all existing groups. He has to uncheck all group boxes in its settings tab.
Is there a way to fix this? How come the user has joined all groups after sending a message to one?
Thanks for your help
Olivier
[MODERATOR]- add code between backticks