Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: disable private messaging for specific user

@shanebp

Moderator

You could use this action hook, found in :
buddypress\bp-messages\classes\class-bp-messages-message.php
do_action_ref_array( 'messages_message_before_save', array( &$this ) );

Untested, but try:

function block_the_jerk( $message_info ) {

   if( $message_info->sender_id == 666 )  // change 666 to jerk's user_id
       unset( $message_info->recipients );

   return $message_info;
}
add_action( 'messages_message_before_save', 'block_the_jerk');

This should remove all recipients – causing the send message function to return false.
I’m not sure what if any feedback the jerk will see.

Skip to toolbar