Last active
December 28, 2015 06:48
-
-
Save pento/7459299 to your computer and use it in GitHub Desktop.
Prevent password leaks in WordPress comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hunter2( $comment_text, $comment ) { | |
if ( get_current_user_id() !== $comment->user_id ) { | |
$comment_text = str_replace( 'hunter2', '*******', $comment_text ); | |
} | |
return $comment_text; | |
} | |
add_filter( 'get_comment_text', 'hunter2', 1, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment