Skip to:
Content
Pages
Categories
Search
Top
Bottom

Private Messages


  • carolinakod3
    Participant

    @carolinakod3

    Hello,

    Is there a way to remove e-mail IDs and consecutive numbers from private messages sent between users?

    This code was found online for email IDs. Can someone please advise? Thank you in advance.

    /*remove email addresses from private messages
    
    Buddypress remove email id from private messages
    */ function wdw_remove_email_from_private_msg($message){ $replacement = "[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 http://www.linuxjournal.com/article/9585*/ } 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');
  • You must be logged in to reply to this topic.
Skip to toolbar