Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add "will not be published" to the Email input in comment fields
add_filter( 'comment_form_default_fields', 'generate_custom_comment_fields' );
function generate_custom_comment_fields()
{
$fields = array(
'author' => '<input placeholder="' . __( 'Name','generate' ) . ' *" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" />',
'email' => '<input placeholder="' . __( 'Email (will not be published)','generate' ) . ' *" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" />',
'url' => '<input placeholder="' . __( 'Website','generate' ) . '" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />',
);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment