Do you know how to use filters?
Take a look at function send() in
\buddypress\bp-messages\bp-messages-classes.php
It has lots of filters.
I’d use the do_action_ref_array
thank you @shanebp.
I only know enough about filters to get myself into trouble! I’ve just had a look at that one. Are you suggesting that I remove the teacher from the array so they don’t show in the list of members to send to? Is that how that works?
How would that work from the member/student perspective?
I really appreciate any guidance you can give me.
Thank you.
You’ll need to know the user_id for the teacher.
Then check the array for that id. If it’s found, remove it.
And tell the student why, something like:
bp_core_add_message( __( 'You cannot send a private message to the teacher.', 'buddypress' ), 'error' );