Home › Forums › Front End PM PRO › Role to Role block is working for Group › Reply To: Role to Role block is working for Group
April 30, 2018 at 11:04 am
#13865
Shamim Hasan
Keymaster
Please go to class-fep-group-message.php line 320 and change return $user_groups;
to return apply_filters( 'fep_get_user_groups', $user_groups, $user_id );
(this hook will be added to next version, so you will not be needed this change for next version)
Then add following code in your theme’s (child theme’s if any) functions.php
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);
This will allow you to send message to any group without joining that group.