Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to know how to make one of the fields on my comment not NOT required. How can I set the e-mail field in the comment field to not be required, but optional?

share|improve this question

1 Answer 1

Settings > Discussion > Other comment settings > uncheck Comment author must fill out name and e-mail

Update

Well, as far as WP is concerned these are glued together. You can add your own check for empty name, something like this (not tested):

add_filter('preprocess_comment', 'require_comment_author');

function require_comment_author($commentdata) {

    if ('' == $commentdata['comment_author'])
        wp_die('Error: please enter a valid name.');

    return $commentdata;
}

But then will also need to modify form generation so name is marked up as required and email not...

share|improve this answer
    
Yes, but then how would i require them to fill out that name then? I want to require the name and comment, but not the e-mail address. –  user3333 Feb 20 '11 at 15:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.