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 wish to add extra field in post comment section while admin is logged in.

Screenshot

I just add subject field in template comment form.But i couldn't store in db and retrieve it.

How can i do this ? Help me !

share|improve this question

1 Answer 1

You can add it directly through your functions.php, unfortunately this is not documented very well at all.

You want to hook into add_comment_meta using add_action, to look at this further refer to line 500-ish of comment.php.

It looks like this

function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {

    return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);

}
share|improve this answer
    
:could you please explain further. I couldn't see 500-ish line in comment.php. please –  gowri Jul 8 '11 at 12:31
    
Just do a text search for add_comment_meta in comments.php, it is somewhat documented there, phpcrossref.com/wordpress/wp-includes/… –  Wyck Jul 8 '11 at 16:38

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.