Created
June 14, 2019 17:37
-
-
Save deeman/a7d44c68da669486e1aa954711d997d2 to your computer and use it in GitHub Desktop.
How To Remove fields from Comment Form in WordPress
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
| add_filter( 'comment_form_default_fields', 'comment_form_custom_fields' ); | |
| /** | |
| * Remove Email and Website fields in comment form. | |
| * | |
| * @param array $args Default comment form arguments | |
| * @return array Modified comment form arguments | |
| */ | |
| function comment_form_custom_fields( $args ) { | |
| unset( $args['email'] ); | |
| unset( $args['url'] ); | |
| return $args; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment