Reply To: Question about groups messages


Home Forums Front End PM PRO Question about groups messages Reply To: Question about groups messages

#28661
Shamim Hasan
Keymaster

1. Set “To Role” also as student role. Others are same as above. That way students will not be able to send message to other students. For more instruction about this please see https://www.shamimsplugins.com/docs/front-end-pm-pro/getting-started-2/role-to-role-block/

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( array_intersect( [ 'administrator', 'teacher' ], wp_get_current_user()->roles ) ){
            $value = true;
        } else {
            $value = false;
        }
    }
    return $value;
}, 10, 2 );

Change teacher with your teacher user role. After this administrators and teachers will be able to send group message. students will not be able to send group message.

3. For only admin setup please see https://www.shamimsplugins.com/docs/front-end-pm-pro/getting-started-2/only-admin/