Hi ..
I am trying to filter emails from buddypress members messages.
I found this code :
used in functions.php
/*remove email addresses from private messages*/
function wdw_remove_email_from_private_msg($message){
$replacement = “[Warning: Contact removed]“;
/*if you dont want any replacement text, replace the above line with
$replacement = “”;
*/
return preg_replace(“/[^@\s]*@[^@\s]*\.[^@\s]*/”, $replacement, $message);
/*the code is short and works in most cases but not full proof. Check */
}
add_filter(‘messages_message_content_before_save’, ‘wdw_remove_email_from_private_msg’);
add_filter(‘messages_message_subject_before_save’, ‘wdw_remove_email_from_private_msg’);
But when i run it.
I gives me a white blank screen.
Someone who have a solution to filter emails away or can see what is wrong with this code.
Thz.