Skip to content

Instantly share code, notes, and snippets.

@jimihenrik
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimihenrik/762c2e5248f7210847e1 to your computer and use it in GitHub Desktop.
Save jimihenrik/762c2e5248f7210847e1 to your computer and use it in GitHub Desktop.
//hide commenters email and IP from non admins
function filter_comment_email( $email ) { return ''; } // you can return 'private' or something if you want
function filter_comment_author_IP( $ip ) { return ''; }
if (!current_user_can('administrator')) {
add_filter( 'comment_email', 'filter_comment_email' );
add_filter( 'get_comment_author_IP', 'filter_comment_author_IP' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment