Home › Forums › Front End PM PRO › Question about groups messages › Reply To: Question about groups messages
August 29, 2019 at 3:12 pm
#28636
Shamim Hasan
Keymaster
1. Please go to Front End PM PRO > Settings > Security > Role to Role Block > Add New and set “From Role” as student role, “To Role” and teacher role and “Block For” as “New Message”. Then save changes. After this settings students will not be able to send message to teacher.
2. Add following code in your theme’s (child theme’s if you are using) functions.php.
add_filter( 'fep_get_option', function( $value, $option ){
if( 'can-send-to-group' == $option ){
if( in_array( 'teacher', wp_get_current_user()->roles ) ){
$value = true;
} else {
$value = false;
}
}
return $value;
}, 10, 2 );
Change teacher
with your teacher user role. After this only teachers will be able to send group message.