Created
December 28, 2017 10:15
-
-
Save walterebert/8601431f7c5d260b2682f030790ed7bd to your computer and use it in GitHub Desktop.
WordPress snippet: Remove email field from comments
This file contains hidden or 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 | |
add_filter( 'comment_form_default_fields', function( $fields ) { | |
$require_name_email = get_option( 'require_name_email' ); | |
if ( ! $require_name_email ) { | |
unset($fields['email']); | |
} | |
return $fields; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment