@dalincster
the wp functionality allows you to create custom fields
to create custom input fields I added this to my theme functions.php
//custom comment fields
// the po is related to my theme name
function po_custom_comment_fields($fields)
{
global $post;
// i didn't want the default fields so i remove them here
$fields['author'] = '';
$fields['email'] = '';
$fields['url'] = '';
// begin custom fields
$fields['firstname'] = '' . '<label for="firstname">' . __( 'First Name' ) . '</label> ' .
'<input id="firstname" name="firstname" type="text" value="' . esc_attr( $commenter['firstname'] ) . '" size="30" /><span class="required">*</span>';
$fields['lastname'] = '' . '<label for="lastname">' . __( 'Last Name' ) . '</label> ' .
'<input id="lastname" name="lastname" type="text" value="' . esc_attr( $commenter['lastname'] ) . '" size="30" /><span class="required">*</span>';
$fields['location'] = '' . '<label for="location">' . __( 'Location' ) . '</label> ' .
'<input id="location" name="location" type="text" value="' . esc_attr( $commenter['location'] ) . '" size="30" /><span class="required">*</span>';
// add all the fields created above in to a new array and return the new array
$fields = array( $fields['author'], $fields['email'], $fields['url'], $fields['firstname'], $fields['lastname'], $fields['location'] );
return $fields;
}
add_filter( 'comment_form_default_fields', 'po_custom_comment_fields' );
to save the fields
add_action ('comment_post', 'add_meta_settings', 1);
function add_meta_settings($comment_id) {
add_comment_meta($comment_id, 'firstname', $_POST['firstname'], true);
add_comment_meta($comment_id, 'lastname', $_POST['lastname'], true);
add_comment_meta($comment_id, 'location', $_POST['location'], true);
}
there may be a better way, Chip Bennett, above, would probably be more qualified to give input on that, but this was what I did and it works for what i needed to do.
I might not be the best source for this, this is my first WP project in about 3 years